Cheatography
https://cheatography.com
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 Microsoft.PowerToys |
winget install --id Microsoft.PowerToys --v 0.15.2 |
winget install --id Microsoft.PowerToys --uninstall-previous --v 0.15.2 |
The install command of the winget tool installs the specified application
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 applications currently installed
Search
winget search vscode |
winget find vscode |
winget find --id Microsoft.VisualStudioCode |
winget find --name "Microsoft Visual Studio Code" |
winget find --tag vscode |
winget search micro it will match all these Microsoft, Microscope, MyMicro.
Options
-?,--help |
Shows help about the selected command. |
--wait |
Prompts the user to press any key before exiting. |
--logs,--open-logs |
Open the default logs location. |
--verbose, --verbose-logs |
Used to override the logging settings. |
--disable-interactivity |
Disable interactive 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 application |
winget pin list |
lists all current pins |
winget pin list --id Microsoft.PowerToys |
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 application
Configure
winget configure -f myfile.dsc.yml |
command to initiate the set up |
winget configure show -f myfile.dsc.yml |
will display the details of the configuration |
winget configure test -f myfile.dsc.yml |
Checks the system against the desired state |
winget configure validate -f myfile.dsc.yml |
Validates a configuration file. |
The configure command of the winget tool uses a WinGet Configuration file to begin setting up your Windows machine
|
|
Update
winget update --all |
winget upgrade --all |
winget upgrade --all --uninstall-previous |
winget upgrade powertoys --version 0.15.2 |
winget upgrade --id Microsoft.PowerToys |
The upgrade command of the winget tool upgrades the specified application.
Download
winget download PowerToys -v 0.15.2 |
winget download PowerToys -v 0.15.2 --installer-type msix |
winget download PowerToys -v 0.15.2 -d /path/to/download |
By default, the download command will download the appropriate 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 packages.json |
winget export --include-versions -o packages.json |
winget import |
winget import -i packages.json |
winget import --ignore-versions -i packages.json |
The export combined with the import command allows you to batch install applications on your PC.
Logs
winget list --logs |
winget source update --open-logs |
winget install vscode --verbose-logs |
winget search -n visual --verbose-logs |
winget source add -n mysource -t Microsoft.REST -a https://www.contoso.org --verbose |
Windows Package Manager by default creates log files when executing commands.
Hash
winget hash myInstaller.msixbundle |
winget hash -f myInstaller.msixbundle |
winget hash -f myInstaller.msixbundle --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 <command> --help |
Display help for a command. |
winget <command> -? |
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 experimental features available |
|
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets