In this blog post I want to quickly share how you can get started with the new Windows Package Manager and the WinGet CLI. At the Microsoft Build conference 2021, the team announced Windows Package Manager (WinGet) 1.0. The Windows Package Manager was first announced in 2020 as a preview for Windows Insiders. Windows Package Manager is a package manager solution that consists of a command-line tool (winget) and set of services for installing applications on Windows 10. You can use the winget command-line tool to discover, install, upgrade, remove and configure a curated set of applications.
Getting started with Windows Package Manager and WinGet
The Windows Package Manager is distributed with the App Installer from the Microsoft Store. You can also download and install the Windows Package Manager from our GitHub releases page or just directly install the latest available version. Version 1.0 of Windows Package Manager will soon ship as an automatic update via the Microsoft Store for all devices running Windows 10, version 1809 and later. It is also part of the latest Windows 11 preview builds!
To find out more about how to install the Windows Package Manager WinGet, check out my blog post. After it is installed and available on your machine, you can start using it.
Search Application to Install
To search for applications you can simply type the following command
winget search <applicationname>
winget search vscode
This will show applications from the winget repository. You can also enable the preview feature to use the Windows Store as a source for Winget.
You can find more information about searching applications on Microsoft Docs.
Install an application using WinGet
To install an application on Windows using the Windows Package Manager you can write the following command:
winget install <applicationname>
winget install vscode-insiders
You can also use the -h or –silent options to silent mode. This suppresses all UI and the default experience shows installer progress.
winget install vscode-insiders -h
This will install applications from the winget repository. You can also enable the preview feature to use the Windows Store as a source for Winget.
You can find more information about installing applications on Microsoft Docs.
List installed applications
You can also list all the existing applications installed on your machine using the list command.
You can also look for a spesifc application using:
winget list --name azure
In addition to the install version, the command also lists if there is an update available for the application.
You can find more information about listing applications on Microsoft Docs.
Uninstall an application using WinGet
Of course you can also uninstall applications using the uninstall command.
winget uninstall --name "Azure CLI"
It can also uninstall applications, which were not installed using the Windows Package Manager.
You can find more information about uninstalling applications on Microsoft Docs.
Update and Upgrade Applications using WinGet
One of the most important functionalities of a package manager is not just to install new applications but also keep them up-to-date. With the upgrade command you can not only see the applications where an update is available, but also where upgrade them. This also includes applications which were not installed using winget in the past.
To list all the applications with available updates you can run the following command:
To update a specific application you can run:
winget upgrade --id Microsoft.AzureCLI
To update all applications on your machine with available updates using Windows Package Manager, you can use the following winget command:
winget upgrade --all
You can find more information about update and upgrades of applications on Microsoft Docs.
Export and Import Application list to another machine
If you have multiple machine or if you are reinstalling your computer, you can also make an export of all the applications installed on the existing machine. You can then import that file on the new or reinstalled computer, and winget will batch install all the applications.
winget export -o .\myapps.json
When the Windows Package Manager exports the JSON file, it attempts to export all the applications installed on the PC. If the winget export command is not able to match an application to an application from an available source, the export command will show a warning.
To import the list of applications on the new machine, you can run the following command:
winget import -i .\myapps.json
Additional Windows Package Manager and Winget settings
With the winget settings command you can open up the JSON setting file, where you can customize the Windows Package Manager client experience.
A couple of settings you can change in version 1.0 and higher:
- Auto Update Interval
- Visual design of the progress bar
- The install behavior including the scope, locale, and more
To find more options and settings check out Microsoft Docs.
You can find over 1400 unique packages in the Microsoft community repository. And if you want to add packages to the repository can check out the following docs and the Windows Package Manager Manifest Creator. This tool will help you to create a valid manifest you can the commit to the GitHub repo.
If you are looking forward to host private repositories there is also a reference implementation for the REST API source which allows you to host your own private repository.
The Windows Package Manager (winget) is a fantastic tool you can use to manage and install software on your Windows 10 and Windows 11 machine. If you have any questions or you have some cool features to add to the blog, please let me know in the comments.Tags: Application, install, Manager, Microsoft, Package, Tool, Windows, Windows 10, Windows 11, WIndows Package Manager, Winget Last modified: July 5, 2021