Table of Contents
Windows Package Manager
The winget command line tool enables users to discover, install, upgrade, remove and configure applications on Windows 10 and Windows 11 computers. This tool is the client interface to the Windows Package Manager service.
Windows Package Manager winget command-line tool is available on Windows 11 and modern versions of Windows 10 as a part of the App Installer.
Note: The Winget command line tool is only supported on Windows 10 1709 (build 16299) or later at this time. Winget is not officially supported for Windows Server 2022 but can be installed in experimental mode.
Install Winget Package Manager on Windows 11
You can get App Installer from the Microsoft Store. If it’s already installed, make sure it is updated with the latest version.
If you have recently logged in as a user for the first time and find that winget is not yet available, you can open PowerShell or Terminal and enter the following command to request this winget registration:
Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
Without the Microsoft Store, we can install winget manually using Windows PowerShell.
#Install a script from PSGallery
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force
Install-PackageProvider -Name "NuGet" -Force
Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted
Install-Module -Name "PowerShellGet" -Force
Install-Script -Name "winget-install" -Force
winget-install.ps1
#Uninstall the script, we no longer need it
Uninstall-Script -Name "winget-install"
Install winget preview version
Windows App Installer includes the production version of the winget tool. To try the latest Windows Package Manager features, you can install the latest preview build of the winget command line tool in one of the following ways:
Use a Microsoft Account (MSA), work, school or Azure Active Directory (AAD) account to sign up for the Windows Insider Dev Channel.
Use a Microsoft Account (MSA) to sign up for the Windows Package Manager Insiders Program.
Install the Windows Desktop App Installer package located on the Releases page for the winget repository. Installing this package will give you the WinGet client, but it will not enable automatic updates from the Microsoft Store.
The easiest way is installed it using PowerShell with the code below:
#Set path to store download files
New-Item -Path C:\Temp -ItemType Directory -Force
$path = "C:\Temp"
Set-Location $path
#Download winget and license file
function getLink($match) {
$uri = "https://api.github.com/repos/microsoft/winget-cli/releases"
$get = Invoke-RestMethod -uri $uri -Method Get -ErrorAction stop
$data = $get[0].assets | Where-Object name -Match $match
return $data.browser_download_url
}
$url = getLink("msixbundle")
$licenseUrl = getLink("License1.xml")
# Install winget
Invoke-WebRequest -Uri $url -OutFile "winget.msixbundle"
Invoke-WebRequest -Uri $licenseUrl -OutFile "license1.xml"
Add-AppxProvisionedPackage -Online -PackagePath "winget.msixbundle" -LicensePath "license1.xml"
# Cleanup
Remove-Item $path\* -Recurse -Force
Install winget on Windows Sandbox
Windows Sandbox provides a lightweight desktop environment to safely run applications in isolation. Software installed inside the Windows Sandbox environment remains “sandboxed” and runs separately from the host machine. Windows Sandbox does not include winget, nor the Microsoft Store app, so you will need to download the latest winget package from the winget releases page on GitHub.
To install the stable release of winget on Windows Sandbox, follow these steps from a Windows PowerShell command prompt:
#Set path to store download files
New-Item -Path C:\Temp -ItemType Directory -Force
$path = "C:\Temp"
Set-Location $path
#Download winget and license file
function getLink($match) {
$uri = "https://api.github.com/repos/microsoft/winget-cli/releases/latest"
$get = Invoke-RestMethod -uri $uri -Method Get -ErrorAction stop
$data = $get[0].assets | Where-Object name -Match $match
return $data.browser_download_url
}
$url = getLink("msixbundle")
$licenseUrl = getLink("License1.xml")
# Finally, install winget
Invoke-WebRequest -Uri $url -OutFile "winget.msixbundle"
Invoke-WebRequest -Uri $licenseUrl -OutFile "license1.xml"
Invoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx `
-OutFile Microsoft.VCLibs.x64.14.00.Desktop.appx
Add-AppxPackage Microsoft.VCLibs.x64.14.00.Desktop.appx
Add-AppxProvisionedPackage -Online -PackagePath "winget.msixbundle" -LicensePath "license1.xml"
# Cleanup
Remove-Item $path\* -Recurse -Force
Administrator considerations
Installer behavior can be different depending on whether you are running winget with administrator privileges.
When running winget without administrator privileges, some applications may require elevation to install. When the installer runs, Windows will prompt you to elevate. If you choose not to elevate, the application will fail to install.
When running winget in an Administrator Command Prompt, you will not see elevation prompts if the application requires it. Always use caution when running your command prompt as an administrator, and only install applications you trust.
Use winget
After it is installed, you can access winget via the Windows Terminal, PowerShell, or the Command Prompt.
One of the most common usage scenarios is to search for and install a favorite tool.
1. To search for a tool, type winget search <appname>.
2. After you have confirmed that the tool you want is available, you can install the tool by typing winget install <appid>. The winget tool will launch the installer and install the application on your PC.
3. In addition to install and search, winget provides a number of other commands that enable you to show details on applications, change sources, and validate packages. To get a complete list of commands, type: winget –help.
C:\Users\admin>winget
Windows Package Manager v1.4.10173
Copyright (c) Microsoft Corporation. All rights reserved.
The winget command line utility enables installing applications and other packages from the command line.
usage: winget [<command>] [<options>]
The following commands are available:
install Installs the given package
show Shows information about a package
source Manage sources of packages
search Find and show basic info of packages
list Display installed packages
upgrade Shows and performs available upgrades
uninstall Uninstalls the given package
hash Helper to hash installer files
validate Validates a manifest file
settings Open settings or set administrator settings
features Shows the status of experimental features
export Exports a list of the installed packages
import Installs all the packages in a file
For more details on a specific command, pass it the help argument. [-?]
The following options are available:
-v,--version Display the version of the tool
--info Display general info of the tool
-?,--help Shows help about the selected command
--wait Prompts the user to press any key before exiting
--verbose,--verbose-logs Enables verbose logging for WinGet