Table of Contents
Windows Package Manager is a comprehensive package manager solution that consists of a command line tool and set of services for installing applications on Windows 10 and Windows 11. Windows Package Manager uses the winget tool to install and manage software packages.
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.
Download and install the winget tool
Install winget
Windows Package Manager winget command-line tool is bundled with Windows 11 and modern versions of Windows 10 by default as the App Installer.
If you are running an earlier version of Windows and the App Installer is not installed, you can get App Installer from the Microsoft Store. If it’s already installed, make sure it is updated with the latest version.
Install winget preview version
To try the latest Windows Package Manager features, install the latest preview build of the winget command line tool from the winget repository.
Use the winget tool
After App Installer is installed, you can run winget by typing ‘winget‘ from a Command Prompt, PowerShell or Windows Terminal.
PS C:\WINDOWS\system32> winget
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
One of the most common usage scenarios is to search for and install a favorite tool.
Search an app using winget
To search for a tool, type winget search <appname> then take note the app’s id for the next step. For example the id this app is Microsoft.PowerToys.
PS C:\WINDOWS\system32> winget search powertoys
Name Id Version Source
--------------------------------------------------------
Microsoft PowerToys XP89DCGQ3K6VLD Unknown msstore
PowerToys (Preview) Microsoft.PowerToys 0.61.1 winget
Install an app using winget
After you have confirmed that the tool you want is available, you can install the tool by typing winget install –id <appid> -e. The winget tool will launch the installer and install the application on your PC.
The best way to limit the selection to one file is to use the id of the application combined with the exact query option (-e).
winget install --id Microsoft.PowerToys -e
PS C:\WINDOWS\system32> winget install --id Microsoft.PowerToys -e
Found PowerToys (Preview) [Microsoft.PowerToys] Version 0.61.1
Downloading https://github.com/microsoft/PowerToys/.../PowerToysSetup-0.61.1-x64.exe
██████████████████████████████ 87.7 MB / 87.7 MB
Successfully verified installer hash
Starting package install...
Successfully installed
Uninstall an app using winget
The uninstall command requires that you specify the exact string to uninstall. If there is any ambiguity, you will be prompted to further filter the uninstall command to an exact application.
winget uninstall --id Microsoft.PowerToys -e
The options allow you to customize the uninstall experience to meet your needs:
PS C:\WINDOWS\system32> winget uninstall -?
The following arguments are available:
-q,--query The query used to search for a package
The following options are available:
-m,--manifest The path to the manifest of the package
--id Filter results by id
--name Filter results by name
--moniker Filter results by moniker
--product-code Filters using the product code
-v,--version Use the specified version; default is the latest version
-s,--source Find package using the specified source
-e,--exact Find package using exact match
-i,--interactive Request interactive installation; user input may be needed
-h,--silent Request silent installation
--force Override the installer hash check
--purge Deletes all files and directories in the package directory (portable)
--preserve Retains all files and directories created by the package (portable)
-o,--log Log location (if supported)
--header Optional Windows-Package-Manager REST source HTTP header
--accept-source-agreements Accept all source agreements during source operations
If the query provided to winget does not result in a single application to uninstall, then winget will display multiple results. You can then use additional filters to refine the search for a correct application.
PS C:\WINDOWS\system32> winget uninstall terminal
Multiple packages found matching input criteria. Please refine the input.
Name Id Source
--------------------------------------------------
Windows Terminal 9N0DX20HK701 msstore
Windows Terminal Microsoft.WindowsTerminal winget
Uninstalling apps not installed with Windows Package Manager
Before you begin, let’s take a look about the list command of the winget tool displays a list of the applications currently installed on your computer. The list command will show apps that were installed through the Windows Package Manager as well as apps that were installed by other means.
In this example, list was used to find the application, and then the id was passed in as part of uninstall.
PS C:\Windows\system32> winget list
Name Id Version Source
-----------------------------------------------------------------------------------------------------------------------
Google Chrome Google.Chrome 104.0.5112.81 winget
Microsoft Edge Microsoft.Edge 103.0.1264.77 winget
Microsoft Edge Update Microsoft Edge Update 1.3.165.21
Microsoft Edge WebView2 Runtime Microsoft.EdgeWebView2Runtime 104.0.1293.47 winget
Cortana Microsoft.549981C3F5F10_8wekyb3d8bbwe 4.2204.13303.0
MSN Weather Microsoft.BingWeather_8wekyb3d8bbwe 4.53.42091.0
......
App Installer Microsoft.DesktopAppInstaller_8wekyb3d8bbwe 1.18.2091.0
Microsoft 365 Apps for enterprise - en-us Microsoft.Office 16.0.15427.20194 winget
Microsoft OneDrive Microsoft.OneDrive 22.141.0703.0002 winget
Microsoft Teams Microsoft.Teams 1.5.00.21463 winget
Mail and Calendar microsoft.windowscommunicationsapps_8wekyb3d8bbwe 16005.14326.20970.0
VMware Tools {1FF5D624-5515-4343-837A-E54C101573E6} 11.3.5.18557794
Teams Machine-Wide Installer Microsoft.Teams 1.5.0.8070 winget
winget uninstall --id Microsoft.BingWeather_8wekyb3d8bbwe -e
PS C:\Windows\system32> winget uninstall --id Microsoft.BingWeather_8wekyb3d8bbwe -e
Found MSN Weather [Microsoft.BingWeather_8wekyb3d8bbwe]
Starting package uninstall...
██████████████████████████████ 100%
Successfully uninstalled
Upgrade apps using winget
The upgrade command of the winget tool upgrades the specified application. Optionally, you may use the list command to identify the application you want to upgrade.
The upgrade command requires that you specify the exact string to upgrade. If there is any ambiguity, you will be prompted to further filter the upgrade command to an exact application.
To identify which apps are in need of an update, simply use upgrade without any arguments to show all available upgrades.
PS C:\Windows\system32> winget upgrade
Name Id Version Available Source
--------------------------------------------------------------------------------------------
Teams Machine-Wide Installer Microsoft.Teams 1.5.0.8070 1.5.00.17656 winget
1 upgrades available.
PS C:\Windows\system32> winget upgrade --id Microsoft.Teams
Found Microsoft Teams [Microsoft.Teams] Version 1.5.00.17656
Downloading https://statics.teams.cdn.office.net/production-windows-x64/1.5.00.17656/Teams_windows_x64.msi
██████████████████████████████ 122 MB / 122 MB
Successfully verified installer hash
Starting package install...
Successfully installed
Using list and upgrade
To search for an available update for a specific app, use to the list command. Once you have identified that a update is available for your specific app, use upgrade to install the latest.
PS C:\Windows\system32> winget list powertoys
Name Id Version Available Source
--------------------------------------------------------------------
PowerToys (Preview) x64 Microsoft.PowerToys 0.59.0 0.61.1 winget
upgrade –all will identify all the applications with upgrades available. When you run winget upgrade –all the Windows Package Manager will look for all applications that have updates available and attempt to install the updates.
winget upgrade --all