Overview
Windows Package Manager (winget) is a command-line tool designed by Microsoft for managing software packages on Windows 10 or 11 edition. It provides a convenient way for users to search, install, upgrade, and uninstall applications from the command line or scripts.
Installation
This winget
package should have been installed on Windows 10 1709 (build 16299) or later or windows 11 version.
But if you want to manually install this package, you can follow this method
- Go to https://github.com/microsoft/winget-cli
- Download latest package. https://github.com/microsoft/winget-cli/releases/tag/v1.6.3482
- Run the downloaded file, and choose
update
.
Command
winget
provide several command to manage supported software/package on a Windows client computer.
Command | Function |
---|---|
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 |
pin |
Manage package pins |
configure |
Configures the system into a desired state |
download |
Downloads the installer from a given package |
The following options/parameters are available:
Command | Function |
---|---|
-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 |
--logs,--open-logs |
Open the default logs location |
--disable-interactivity |
Disable interactive prompts |
How to use
Search Package.
winget search [package_name]
- Show Package
winget show [package_name]
- Install Package
winget install [package_name]
- Install multiple package
winget install Microsoft.AzureStorageExplorer; winget install Microsoft.VisualStudioCode; winget install Microsoft.AzureCLI
Upgrade package
- Show all package can be updated.
winget upgrade
- Upgrade single package
winget upgrade [package_name]
- Upgrade All Packages
winget upgrade --all
Avoid Package from updating.
If you want to avoid a package from updating when using --all
paramemeter, you need to pin
the package. This way, the package listed on pin
won’t be updated.
- Check the package listed
winget pin list
- Add visual studio code to pin
winget pin add package
- Remove package from PIN
winget pin remove package
Uninstall Package
winget uninstall package_name
Repositories
winget source list
- Add repository
winget source add --name [name] [url]
Example: winget source add --name winget https://winget.azureedge.net/
Cache
- Update repository
winget source update
Example: winget source update
- Remove Repository
winget source remove --name [name]
winget source remove -- winget
- Reset winget sources
winget source reset --force