How To Use Windows Package Manager (WinGet) Tool

The Windows Package Manager (winget) is a package manager specific to the Windows operating system and provides package management on Windows 10 and Windows 11. The winget command is similar to what many Linux users are already familiar with, such as the apt and yum package managers. For those unfamiliar, a package manager allows system users to install, upgrade, configure, verify, and remove software efficiently using a program specifically tailored to handle these operations. In this post, I will help you install and run winget, verify, get help, install, upgrade, and uninstall packages using this underutilized Windows utility.

Community Repository: Open Source Packages

Microsoft provides an open-source Windows Package Manager community repository which contains the manifest files for all winget packages. This winget repository is the location where metadata information is pulled when performing metadata searches with winget on Windows 11 and 10.

Is winget included in Microsoft Windows 10 & Windows 11?

The Windows Package Manager (winget) is included by default on all Windows releases since Windows 10 version 1709. Microsoft's package manager winget is included by default in all subsequent Windows 10 versions, winget is also pre-installed on Windows 11 versions.

Verifying Windows Package Manager (WinGet) Installation

If you're using Windows 10 and 11, the winget tool may already be installed! First, ensure that winget still needs to be installed on your system with the following command. You can do so through either a PowerShell or Command Prompt terminal. In this example, I will use the winget tool through the PowerShell terminal.

The chances that winget is already installed on your system are relatively high if you own a Windows 10 or Windows 11 installation. You can verify this with the following command from a PowerShell or Command-Line Terminal.

winget --version

How to get winget version with winget-cli.

Install WinGet on Windows

If winget is not already installed on your Windows machine there are a couple of different ways we can install this application. Either through the Microsoft store or manually through GitHub.

Install winget from the Microsoft Store

If not already installed you can install winget through the Microsoft App Store under the Microsoft App Installer application. You can go to the Microsoft Store App Installer page here.

Microsoft Store Page - App Installer

Install winget in a Windows Sandbox

Another option is to install winget in the Windows Sandbox, this sandbox does not include winget or the Microsoft Store application so you’ll need to manually install winget with the following script directly from GitHub.

You can find more information on installing winget by visiting the winget installation documentation, here.

Use Windows Package Manager (winget)

The Windows Package Manager (winget) is a powerful tool that allows Windows users the ability to install and manage packages and applications through the command line.

Use winget: Getting Help & Usage Information

You can use the following command once winget is installed to see a list of winget command-line options.

winget --help

How to get help information through winget-cli.

If you would like to see what command line options are available for a specific command you can use the following syntax.

winget <command> --help

As an example, consider we want to find what options exist for the install command. We can use the following command.

winget install --help

How to get install help information through winget-cli.

As you can see finding how to correctly use the winget-cli is a straightforward process. You can find more information on using winget from the Microsoft learn portal here.

Use winget: Searching For Windows Packages & Apps

Searching for available packages with winget is simple using the search command.

winget search

For example if I want to search for packages with powershell in the tag or description I can use the following command.

winget search powershell

winget search powershell results

The search results will return information such as package name, ID, version, match (such as tag or description), and source.

Use winget: Getting Windows Package & App Information

We can see details on specific packages using the show command. This command will show us package metadata such as version, publisher, publisher url, support url, homepage, licenses, and description. Many packages will also include critical information such as release notes and security fixes.

winget show Microsoft.OpenSSH.Beta

winget show Microsoft.OpenSSH.Beta powershell command

winget show Microsoft.OpenSSH.Beta

Use winget: Installing Windows Packages & Apps

In order to install packages with winget we can use the install command. It's important to understand the ramifications of installing potentially malicious software, it's essential to only install applications you trust.

winget install

For example if we want to install the PowerToys package we can use the following command.

winget install Microsoft.PowerToys

winget install Microsoft.PowerToys

Use winget: Upgrading Windows Packages & Apps

It is easy to upgrade winget through a Windows terminal using the upgrade command. The following command will return a list of applications available to upgrade

winget upgrade

If you want to upgrade a single package, for example Microsoft PowerToys you can use the following command.

winget upgrade Microsoft.PowerToys

If you simply want to upgrade ALL applications you can run the following command.

winget upgrade -h –all

Uninstalling Packages & Applications with WinGet

Uninstalling packages with winget is simple with the uninstall command.

winget uninstall

For example if I want to uninstall the Microsoft PowerToys package I can simply use the following command.

winget uninstall Microsoft.PowerToys

winget uninstall powertoys

Conclusion

Microsoft winget is a great way for Windows users to leverage a package manager to interact with packages on Microsoft Windows. Using winget makes it easy for developers and administrators to automate and integrate package workflows through the terminal and scripting the process of searching and installing apps and packages with the windows package manager. If you’re a developer you can find information on how to submit packages to Windows Package Manager here.

Have questions using WinGet? Reach out to me on social media!

Previous
Previous

How To Install Windows 10 on VMware Fusion

Next
Next

Exploring Defense Evasion through Reflective Code Loading (T1620)