Upgrade gh.exe -- the github CLI

One ghastly day you'll see a message like this:

A new release of gh is available: 2.21.1 → 2.27.0
https://github.com/cli/cli/releases/tag/v2.27.0

How do you upgrade?

Upgrade on Windows

For Winget:

winget upgrade --id GitHub.cli

For Scoop:

scoop update gh

For Chocolatey:

choco upgrade gh

You don't need to run the command from an elevated prompt.

See also