Table of contents
WingetCLI
Installing
PowerShell
Get the download URL of the latest winget installer from GitHub:
$API_URL = "https://api.github.com/repos/microsoft/winget-cli/releases/latest"
$DOWNLOAD_URL = $( Invoke-RestMethod $API_URL ).assets.browser_download_url |
Where-Object { $_.EndsWith(".msixbundle") }
Download the installer:
Invoke-WebRequest -URI $DOWNLOAD_URL -OutFile winget.msixbundle -UseBasicParsing
Install winget:
Add-AppxPackage winget.msixbundle
Remove the installer:
Remove-Item winget.msixbundle
If you get an error that the framework “Microsoft.UI.Xaml.2.7” could not be found, then you can use the following commands to install it:
Invoke-WebRequest `
-URI https://www.nuget.org/api/v2/package/Microsoft.UI.Xaml/2.7.3 `
-OutFile xaml.zip -UseBasicParsing
New-Item -ItemType Directory -Path xaml
Expand-Archive -Path xaml.zip -DestinationPath xaml
Add-AppxPackage -Path "xaml\tools\AppX\x64\Release\Microsoft.UI.Xaml.2.7.appx"
Remove-Item xaml.zip
Remove-Item xaml -Recurse
If you then get another error that the framework “Microsoft.VCLibs.140.00.UWPDesktop” could not be found, then you can additionally use the
following commands to install it:
Invoke-WebRequest `
-URI https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx `
-OutFile UWPDesktop.appx -UseBasicParsing
Add-AppxPackage UWPDesktop.appx
Remove-Item UWPDesktop.appx
Then, repeat the initial commands
Once you have followed the above steps, you can use winget on the command line. For example, to update PowerShell:
winget install --id Microsoft.Powershell --source winget
Remember to again run this with administrative privileges. If you want to execute it in PowerShell itself, prefix the line with an ampersand
&
PowerShell 7+
A prerelease version of the
Microsoft.WinGet.Client
PowerShell
module has been published to the PowerShell Gallery and will no longer be
included as a release asset.
To install the
latest version of thePowerShell
module, run the following command inPowerShell 7+
Install-Module -Name Microsoft.WinGet.Client
The PowerShell module requires
App Installer (winget)
to be installed. TheRepair-WinGetPackageManager cmdlet
(work in progress) is designed to
install or repairApp Installer
Quick Scripts
Install Command
winget install --id Logitech.UnifyingSoftware --force --accept-package-agreements --accept-source-agreements -h -l "C:\Users\Brandon003842\LogiTech"
install multiple pieces of software
winget install Microsoft.AzureStorageExplorer; winget install Microsoft.VisualStudioCode; winget install Microsoft.AzureCLI
Options
Option | Description |
---|---|
-m, –manifest | Must be followed by the path to the manifest (YAML) file. You can use the manifest to run the install experience from a local YAML file. |
–id | Limits the install to the ID of the application. |
–name | Limits the search to the name of the application. |
–moniker | Limits the search to the moniker listed for the application. |
-v, –version | Enables you to specify an exact version to install. If not specified, latest will install the highest versioned application. |
-s, –source | Restricts the search to the source name provided. Must be followed by the source name. |
–scope | Allows you to specify if the installer should target user or machine scope. |
-e, –exact | Uses the exact string in the query, including checking for case-sensitivity. It will not use the default behavior of a substring. |
-i, –interactive | Runs the installer in interactive mode. The default experience shows installer progress. |
-h, –silent | Runs the installer in silent mode. This suppresses all UI. The default experience shows installer progress. |
–locale | Specifies which locale to use (BCP47 format). |
-o, –log | Directs the logging to a log file. You must provide a path to a file that you have the write rights to. |
–override | A string that will be passed directly to the installer. |
-l, –location | Location to install to (if supported). |
–force | Overrides the installer hash check. Not recommended. |
Upgrade
winget upgrade --all --include-unknown
Uninstall
winget uninstall Microsoft.AzureStorageExplorer
Options
Option | Description |
---|---|
-m, –manifest | Must be followed by the path to the manifest (YAML) file. You can use the manifest to run the uninstall experience from a local YAML file. |
–id | Limits the uninstall to the ID of the application. |
–name | Limits the search to the name of the application. |
–moniker | Limits the search to the moniker listed for the application. |
-v, –version | Enables you to specify an exact version to uninstall. If not specified, latest will uninstall the highest versioned application. |
-s, –source | Restricts the search to the source name provided. Must be followed by the source name. |
-e, –exact | Uses the exact string in the query, including checking for case-sensitivity. It will not use the default behavior of a substring. |
-i, –interactive | Runs the uninstaller in interactive mode. The default experience shows uninstaller progress. |
-h, –silent | Runs the uninstaller in silent mode. This suppresses all UI. The default experience shows uninstaller progress. |
-o, –log | Directs the logging to a log file. You must provide a path to a file that you have the write rights to. |
–locale | Specifies which locale to use (BCP47 format). |
-o, –log | Directs the logging to a log file. You must provide a path to a file that you have the write rights to. |
–override | A string that will be passed directly to the installer. |
-l, –location | Location to install to (if supported). |
–force | Overrides the installer hash check. Not recommended. |
Find software to install
winget search
Browse a Windows Package Manage repository
manifests / m / Microsoft / PowerShell / 7.1.4.0
NuGet
Install
Using dotnet CLI
Chocolatey
install using nuget