Windows Package Manager | Microsoft Learn

The winget command-line tool allows users to discover, install, update, remove, and configure apps on Windows 10 and Windows 11 computers. This tool is the client interface of the Windows Package Manager service.

Install

winget Windows Package Manager

The winget command-line tool is available in Windows 11 and modern versions of Windows 10 as part of the application installer

.

You can get the App Installer from the Microsoft Store. If it is already installed, make sure it is updated to the latest version.

Install winget preview

[Developers only]

The Windows Application Installer includes the production version of the winget tool. To test the latest features of Windows Package Manager, you can install the latest preview version 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 Development Channel. Use a Microsoft account (MSA) to

  • sign up for the Windows

  • Package Manager Insiders Program

  • .

  • Install the Windows desktop application installer package found on the Versions page of the winget repository. Installing this package will provide you with the WinGet client, but will not enable automatic updates from the Microsoft Store.

Install winget on Windows Sandbox Windows Sandbox

provides a lightweight desktop environment for running applications securely in isolation. Software installed within the Windows Sandbox environment remains “sandboxed” and runs separately from the host computer. Windows Sandbox doesn’t include winget, nor does the Microsoft Store app, so you’ll need to download the latest winget package from the winget releases page on GitHub.

To install the stable version of winget in the Windows Sandbox, follow these steps from a Windows PowerShell command prompt:

$progressPreference = ‘silentlyContinue’ $latestWingetMsixBundleUri = $(Invoke-RestMethod https://api.github.com/repos/microsoft/winget-cli/releases/latest).assets.browser_download_url | Where-Object {$_. EndsWith(“.msixbundle”)} $latestWingetMsixBundle = $latestWingetMsixBundleUri.Split(“/”)[-1] Write-Information “Downloading winget to artifact directory…” Invoke-WebRequest -Uri $latestWingetMsixBundleUri -OutFile “./$latestWingetMsixBundle” 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-AppxPackage $ latestWingetMsixBundle

If you want a preview or a different version of the Package Manager, go to https://github.com/microsoft/winget-cli/releases. Copy the URL of your preferred version and update the previous URI.

For more information about Windows Sandbox, including how to install a sandbox and what to expect from using it, see the Windows Sandbox documents.

Administrator considerations

The behavior of the installer may 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 it to what it elevates. If you choose not to elevate, the app will not install.

  • When you run winget at an administrator command prompt, you will not see elevation messages if the application requires it. Always be careful when running the command prompt as an administrator, and only install apps that you trust.

Using winget After installing the

Application Installer, you can run winget by typing ‘winget’ from a command prompt. One of

the most common usage scenarios is to find and install

a favorite tool.

  1. To search for a tool, type winget search <appname

  2. >.

  3. Once you have confirmed that the tool you want is available, you can install the tool by typing WinGet install <AppName>. The winget tool will launch the installer and install the application on your PC.

  4. In addition to installing and searching, winget provides a number of other commands that allow you to display details about applications, change sources, and validate packages. For a complete list of commands, type: winget -help.

Some users have reported problems with the client that is not in their PATH.

Commands

The current preview version of the winget tool supports the following commands.

Command description information Displays metadata about the system (version numbers, architecture, registry location, and so on). Useful for troubleshooting. install Installs the specified application. show Displays details of the specified application. source Adds, removes, and updates Windows Package Manager repositories to which the winget tool has access. search Search for an app. list Show installed packages. upgrade Updates the given package. uninstall Uninstall the given package. hash Generates the SHA256 hash for the installer. validate Validates a manifest file to push to the Windows Package Manager repository. settings Open settings. features Displays the status of experimental features. export Exports a list of installed packages. import Installs all packages in a file.

Options

The winget tool supports the following options.

Description of the –v, –version option Returns the current version of winget. -information Provides all detailed information about Winget, including links to the license, privacy statement, and configured Group Policies. -?-help Shows additional help for winget.

Supported installer formats

The winget tool supports the following types of installers:

  • EXE (with Silent and SilentWithProgress flags)
  • INNO
  • NULLSOFT
  • MSI APPX MSIX
  • BURN
  • PORTABLE

Winget scripting

You can create batch scripts and PowerShell scripts to install multiple applications.

@echo disable Echo Install Powertoys and Terminal REM Powertoys winget install Microsoft.Powertoys if %ERRORLEVEL% EQU 0 Echo Powertoys installed correctly. REM Terminal winget install Microsoft.WindowsTerminal if %ERRORLEVEL% EQU 0 Echo Terminal installed correctly. %ERRORLEVEL% Winget

debugging and troubleshooting

provides logging to help diagnose problems. For troubleshooting information and registry details, see Debugging and troubleshooting.

Missing tools

If the community repository does not include your tool or application, please submit a package to our repository. By adding your favorite tool, it will be available to you and everyone else.

Customize

winget settings

You can configure the winget command-line experience by modifying the settings.json file. For more information, see https://aka.ms/winget-settings. Note that the configuration is still in an experimental state and is not yet finalized for the preview version of the tool.

Open Source Details

The winget tool is open source software available on GitHub in the repository https://github.com/microsoft/winget-cli/. The source for compiling the client is located in the src folder.

The winget source is contained in a Visual Studio 2019 C++ solution. To build the solution successfully, install the latest version of Visual Studio with the C++ workload.

We encourage you to contribute to the winget source on GitHub. You must first accept and sign the Microsoft CLA.

Troubleshooting

The winget-cli repository maintains a list of common problems and common errors, along with recommendations on how to resolve them

: Common issues: Not

  • recognized, failed to run, application installer version or PATH variable needs updating
  • Common errors: error 0x801901a0, 0x80d03002, 0x80070490