doc/windows/package-manager/winget/index.md
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.
There are several ways to install the winget tool:
The winget tool is included in the flight or preview version of Windows App Installer. You must install the preview version of App Installer to use winget. To gain early access, submit your request to the Windows Package Manager Insiders Program. Participating in the flight ring will guarantee you see the latest preview updates.
Participate in the Windows Insider Dev Channel.
Install the Windows Desktop App Installer package located on the Releases page for the winget repository.
The winget tool is supported on Windows 10, version 1809 (build 17763) and above.
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.
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.
winget search <appname>.winget install <appname>. The winget tool will launch the installer and install the application on your PC.
winget --help.
The current preview of the winget tool supports the following commands.
| Command | Description |
|---|---|
| install | Installs the specified application. |
| show | Displays details for the specified application. |
| source | Adds, removes, and updates the Windows Package Manager repositories accessed by the winget tool. |
| search | Searches for an application. |
| list | Display installed packages. |
| upgrade | Upgrades the given package. |
| uninstall | Uninstalls the given package. |
| hash | Generates the SHA256 hash for the installer. |
| validate | Validates a manifest file for submission to the Windows Package Manager repository. |
| settings | Open settings. |
| features | Shows the status of experimental features. |
| export | Exports a list of the installed packages. |
| import | Installs all the packages in a file. |
| pin | Manage package pins. |
| configure | Configures the system into a desired state. |
| download | Downloads the installer from a given package. |
The current version of the winget tool supports the following options.
| Option | Description |
|---|---|
| -v, --version | Returns the current version of winget. |
| --info | Provides you with all detailed information on winget, including the links to the license, privacy statement, and configured group policies. |
| -?, --help | Shows additional help for winget. |
| --wait | Waits for user input upon command completion. |
| --logs,--open-logs | Open the default logs location |
| --verbose,--verbose-logs | Enables verbose logging for winget |
| --disable-interactivity | Disable interactive prompts |
The current version of the winget tool supports the following types of installers:
You can author batch scripts and PowerShell scripts to install multiple applications.
@echo off
Echo Install Powertoys and Terminal
REM Powertoys
winget install Microsoft.Powertoys
if %ERRORLEVEL% EQU 0 Echo Powertoys installed successfully.
REM Terminal
winget install Microsoft.WindowsTerminal
if %ERRORLEVEL% EQU 0 Echo Terminal installed successfully. %ERRORLEVEL%
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.
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.
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.
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 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.