Use the winget tool to install and manage applications (2024)

  • Article

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.

Install winget

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.

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

Note

The winget command line tool is only supported on Windows 10 1709 (build 16299) or later at this time. The winget tool will not be available until you have logged into Windows as a user for the first time, triggering Microsoft Store to register Windows Package Manager as part of an asynchronous process. 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 and enter the following command to request this winget registration: Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.

Install winget preview version [Developers Only]

WinGet is included in the Windows App Installer. To try the latest Windows Package Manager features, you can install a preview build one of the following ways:

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:

$progressPreference = 'silentlyContinue'Write-Information "Downloading WinGet and its dependencies..."Invoke-WebRequest -Uri https://aka.ms/getwinget -OutFile Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundleInvoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile Microsoft.VCLibs.x64.14.00.Desktop.appxInvoke-WebRequest -Uri https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.7.3/Microsoft.UI.Xaml.2.7.x64.appx -OutFile Microsoft.UI.Xaml.2.7.x64.appxAdd-AppxPackage Microsoft.VCLibs.x64.14.00.Desktop.appxAdd-AppxPackage Microsoft.UI.Xaml.2.7.x64.appxAdd-AppxPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle

If you would like a preview or different version of the Package Manager, go to https://github.com/microsoft/winget-cli/releases. Copy the URL of the version you would prefer and update the above Uri.

For more information on Windows Sandbox, including how to install a sandbox and what to expect from it's usage, see the Windows Sandbox docs.

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 App Installer is installed, you can run winget by typing 'winget' from a 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 <appname>. The winget tool will launch the installer and install the application on your PC.Use the winget tool to install and manage applications (1)

  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.Use the winget tool to install and manage applications (2)

Some users have reported issues with the client not being on their PATH.

Commands

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

CommandDescription
infoDisplays metadata about the system (version numbers, architecture, log location, etc). Helpful for troubleshooting.
installInstalls the specified application.
showDisplays details for the specified application.
sourceAdds, removes, and updates the Windows Package Manager repositories accessed by the winget tool.
searchSearches for an application.
listDisplay installed packages.
upgradeUpgrades the given package.
uninstallUninstalls the given package.
hashGenerates the SHA256 hash for the installer.
validateValidates a manifest file for submission to the Windows Package Manager repository.
settingsOpen settings.
featuresShows the status of experimental features.
exportExports a list of the installed packages.
importInstalls all the packages in a file.
pinManage package pins.
configureConfigures the system into a desired state.
downloadDownloads the specified application's installer.

Options

The winget tool supports the following options.

OptionDescription
-v, --versionReturns the current version of winget.
--infoProvides you with all detailed information on winget, including the links to the license, privacy statement, and configured group policies.
-?, --helpShows additional help for winget.

Supported installer formats

The winget tool supports the following types of installers:

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

Scripting winget

You can use the following syntax to install multiple applications in a single command.

USAGE: winget install <query1> <query2> ...

Example

winget install Microsoft.WindowsTerminal Microsoft.PowerToys Microsoft.VisualStudioCode

Note

When scripted, winget will launch the applications in the specified order. When an installer returns success or failure, winget will launch the next installer. If an installer launches another process, it is possible that it will return to winget prematurely. This will cause winget to install the next installer before the previous installer has completed.

Debugging and troubleshooting

winget provides logging to help diagnose issues. For troubleshooting and details on logging, see Debugging and troubleshooting.

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 settings are still in an experimental state and 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 repo https://github.com/microsoft/winget-cli/. The source for building the client is located in the src folder.

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

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

Troubleshooting

The winget-cli repo maintains a list of common issues and common errors, along with recommendations on how to resolve:

Use the winget tool to install and manage applications (2024)
Top Articles
Latest Posts
Article information

Author: Domingo Moore

Last Updated:

Views: 6239

Rating: 4.2 / 5 (73 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Domingo Moore

Birthday: 1997-05-20

Address: 6485 Kohler Route, Antonioton, VT 77375-0299

Phone: +3213869077934

Job: Sales Analyst

Hobby: Kayaking, Roller skating, Cabaret, Rugby, Homebrewing, Creative writing, amateur radio

Introduction: My name is Domingo Moore, I am a attractive, gorgeous, funny, jolly, spotless, nice, fantastic person who loves writing and wants to share my knowledge and understanding with you.