A little more than a year ago, with very little fanfare, Microsoft sneaked a very cool, very powerful little utility into Windows. It's called the Windows Package Manager or winget for short. winget is Microsoft's answer to apt or yum (or other) application package managers on Linux orHomeBrewon the Mac.winget lets you easily install, update, and remove Windows applications from a DOS command line. Not only is this a great way to install apps on Windows, it allows easy scripting so that you can easily spin up a new machine with your favorite apps.

winget was introduced with Windows 1709 (The 2020 Fall Creators Update). If you've been updating your PC regularly winget is probably on your PC. Open a command line and type winget to see if it's installed. If it is, you'll see a screen like Figure 1 below:

Figure 1. winget is installed

If you get an error, first use winver from a command line to make sure you have version 1709 or higher as shown in Figure 2 below:

Figure 2. Using WinVer to see what version of Windows you have installed

If you don't have winget installed but do have Windows version 1709 or later, use these directions to install it or install it manually from this site.

Using winget

Typing winget without command line arguments shows winget's available commands:

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    Upgrades the given package
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

To get a sense of the software that winget provides, use the search command without any arguments:

winget search

You can also use the winget.run site to search for winget packages.

In mid-November, 2021, more than 2900 software packages are available through winget. Many are free, or at least "freemium" packages, but some need to be licensed, so after installing you may need to acquire a license. winget's philosophy is that you generally know what you're looking for. Therefore, if you are unfamiliar with a package you see listed, it's prudent to research with Google before installing it. That said, if you're using it to set up a PC with your favorite utilities, you probably already know what you want.

Let's assume you want to install the Firefox Developer Edition browser. First, search for Firefox with this command:

winget search firefox

winget responds with the packages that reference 'firefox'

Figure 3. Using winget's search command

We want to install the product in the red box, so type

winget install "Firefox Developer Edition"

on the command line and press enter. In less than a minute, Firefox Developer Edition is installed for you.

If, like me, you use MS Edge exclusively as downloader for Firefox Developer Edition or Chrome, rejoice that with winget you don't need MS Edge for anything!

Some products have multiple source entries in the winget product repository. Let's say you want to download 7-Zip, the popular zip utility. When you search for 7-Zip, winget displays:

Figure 4. winget showing multiple app sources

This means there is more than one source in the winget repository that provides the download you requested. I didn't like the sound of "Unofficial" so I downloaded 7-Zip from the winget source by using the -s flag:

winget install 7-Zip -s winget

Scriptable installs

With virtual machines so easily available now it's not uncommon for me to need to spin three or four VMs per month. I have a text file named winget-install.txt with the following contents:

winget install "Firefox Developer Edition"
winget install "Visual Studio Professional 2019"
winget install "Microsoft SQL Server 2019 Developer"
winget install "Microsoft SQL Server Management Studio"
winget install "Microsoft Visual Studio Code"
winget install winmerge
winget install Notepad++ -s winget
winget install 7zip -s msstore 
winget install everything -s winget
winget install fileseek
winget install "Docker Desktop"
winget install "Python 3.9" 
winget install sharex -s winget
winget install COM-SQLite    
winget install "DB Browser for SQLite"

winget's Import command installs all of those applications with a single command:

winget import -i winget-install.txt

In just a few minutes, most of the applications needed are ready to go. ASNA products (and a few others) need to be installed manually but winget provides a huge head start for setting up a developer's PC.

For quickly spinning up a new developer PC, winget is highly recommended. Read more about it here and/or watch this YouTube video.



Please login or create an account to post comments.