Show Menu
Cheatography

The Windows Package Manager (winget) is a robust utility from Microsoft, designed as an equivalent to Linux's apt-get. This powerful tool enables users to automate software installations and upgrades directly through the command line interface (CLI), streamlining the process of managing applications on Windows.

Info

winget --info
To get system info like arch.
winget --version
To get winget version
winget -v
The info command of the winget tool displays metadata about the system

Install

winget install powertoys
winget add powertoys
winget install --id Micros­oft.Po­werToys
winget install --id Micros­oft.Po­werToys --v 0.15.2
winget install --id Micros­oft.Po­werToys --unin­sta­ll-­pre­vious --v 0.15.2
The install command of the winget tool installs the specified applic­ation

Uninstall

winget uninstall powertoys
winget remove powertoys
winget rm powertoys
winget uninstall --name powertoys --version 0.15.2
The uninstall command requires that you specify the exact string to uninstall.

List

winget list
shows the installed apps
winget ls
alternate linux style
winget list -s winget
source is winget
winget ls -n 10
limits to 10 rows
winget upgrade
List all apps with available updates
The list command of the winget tool displays a list of the applic­ations currently installed

Search

winget search vscode
winget find vscode
winget find --id Micros­oft.Vi­sua­lSt­udi­oCode
winget find --name "Microsoft Visual Studio Code"
winget find --tag vscode
winget search micro it will match all these Microsoft, Micros­cope, MyMicro.

Options

-?,--help
Shows help about the selected command.
--wait
Prompts the user to press any key before exiting.
--logs­,--­ope­n-logs
Open the default logs location.
--verbose, --verb­ose­-logs
Used to override the logging settings.
--disa­ble­-in­ter­act­ivity
Disable intera­ctive prompts.
The options allow you to customize the experience to meet your needs.

Pin

winget pin add powertoys
adds a new pin
winget pin add --tag dotnet --blocking
adds a blocking pin
winget pin add --tag dotnet --version 0.70.*
adds a gating pin
winget pin remove powertoys
removes a pin for an applic­ation
winget pin list
lists all current pins
winget pin list --id Micros­oft.Po­werToys
List pin with matching id
winget pin reset
shows all pins that would be reset
winget pin reset --force
resets all existing pins
The winget pin command allows you to limit the Windows Package Manager from upgrading

Show

winget show vscode
winget view vscode
displays details for the specified applic­ation

Configure

winget configure -f myfile.ds­c.yml
command to initiate the set up
winget configure show -f myfile.ds­c.yml
will display the details of the config­uration
winget configure test -f myfile.ds­c.yml
Checks the system against the desired state
winget configure validate -f myfile.ds­c.yml
Validates a config­uration file.
The configure command of the winget tool uses a WinGet Config­uration file to begin setting up your Windows machine
 

Update

winget update --all
winget upgrade --all
winget upgrade --all --unin­sta­ll-­pre­vious
winget upgrade powertoys --version 0.15.2
winget upgrade --id Micros­oft.Po­werToys
The upgrade command of the winget tool upgrades the specified applic­ation.

Download

winget download PowerToys -v 0.15.2
winget download PowerToys -v 0.15.2 --inst­all­er-type msix
winget download PowerToys -v 0.15.2 -d /path/­to/­dow­nload
By default, the download command will download the approp­riate installer to the user's Downloads folder.

Tab completion

winget ⇥
winget install
winget sh⇥
winget show
winget source l⇥
winget source list
winget -⇥
winget --version
winget install power⇥
winget install "­Power Toys"
winget install "­Power Toys" --version ⇥
winget install "­Power Toys" --version 0.19.2
Repeated presses of tab (⇥) will result in cycling through the possible values.

Export & Import

winget export
winget export -o packag­es.json
winget export --incl­ude­-ve­rsions -o packag­es.json
winget import
winget import -i packag­es.json
winget import --igno­re-­ver­sions -i packag­es.json
The export combined with the import command allows you to batch install applic­ations on your PC.

Logs

winget list --logs
winget source update --open­-logs
winget install vscode --verb­ose­-logs
winget search -n visual --verb­ose­-logs
winget source add -n mysource -t Micros­oft.REST -a https:­//w­ww.c­on­tos­o.org --verbose
Windows Package Manager by default creates log files when executing commands.

Hash

winget hash myInst­all­er.m­si­xbundle
winget hash -f myInst­all­er.m­si­xbundle
winget hash -f myInst­all­er.m­si­xbundle --msix
The hash command of the winget tool generates the SHA256 hash for an installer.

Help

winget --help
Display help for all commands.
winget -?
Display help for all commands.
winget <co­mma­nd> --help
Display help for a command.
winget <co­mma­nd> -?
Display help for a command.
The help command of the winget tool displays help for all the supported commands

Source

winget source list
winget source add --name Contoso myurl
winget source update -n Contoso
winget source refresh -n Contoso
winget source remove -n Contoso
winget source rm -n Contoso
winget source reset --force
winget source export winget
source command allows you to manage sources for Windows Package Manager.

Settings

winget settings
winget Config
Allows you to customize your Windows Package Manager client experience

Misc

winget validate --manifest myfile.yml
validates a manifest for submitting software
winget features
list of the experi­mental features available
       
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          VLC (Windows & OS X) Keyboard Shortcuts
          Sublime Text 2 Windows Keyboard Shortcuts
          Amethyst Windows Shortcuts Keyboard Shortcuts