Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Windows 10 / Using WinGet Package Manager on Windows 10 and 11

May 10, 2023 PowerShellWindows 10Windows 11

Using WinGet Package Manager on Windows 10 and 11

A new native package manager, WinGet (Windows Package Manager), appeared on Windows 10 and 11. You can use it to install apps from the command prompt (similar to Linux package managers like yum, dnf, apt, etc.).

WinGet.exe is a console tool making app installation easier on a computer running Windows (like Chocolatey package manager). To install a program, you don’t need to search official sites, download the installation files and install apps manually. Using Windows Package Manager, you can install or update any program from the repository with just one command.

Contents:
  • How to Install WinGet Package Manager on Windows 10?
  • Deploying Software Packages in Windows using WinGet
  • Winstall: Web GUI for WinGet Package Manager
  • WinGet: Updating and Removing Packages on Windows
  • Export and Import Installed Software List to Another Computer via WinGet

How to Install WinGet Package Manager on Windows 10?

You can install WinGet on Windows 10 with build 1709 or newer. Winget is already embedded into the image of the current Windows 11 21H2 and Windows 10 21H1 builds.

To check if winget is installed on your computer, open a PowerShell console and run the command:

Get-AppPackage *Microsoft.DesktopAppInstaller*|select Name,PackageFullName

In our case, winget is installed (the name of the UWP application is Microsoft.DesktopAppInstaller).

check if winget is installed on windows 10/11

You can only use winget on desktop versions of Windows (10 and 11). Winget is not officially supported for Windows Server 2022, but can be installed in experimental mode.

You can install WinGet from the Microsoft Store (it is called App Installer there) https://www.microsoft.com/en-us/p/app-installer/9nblggh4nns1#activetab=pivot:overviewtab

WinGet (App Installer) on Microsoft Store

To install Winget, MS Store must be running on your computer (if Microsoft Store is removed or damaged, you can reinstall or repair it).

Also, you can install winget manually using PowerShell (if you removed built-in UWP apps in Windows). To do this, you need to use PowerShell to download the winget msixbundle file from GitHub (https://github.com/microsoft/winget-cli/releases) and install it:

Invoke-WebRequest -Uri "https://github.com/microsoft/winget-cli/releases/download/v1.1.12653/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" -OutFile "C:\PS\WinGet.msixbundle"
Add-AppxPackage "C:\PS\WinGet.msixbundle"

download and install winget on windows 10

You can also download and install the WinGet package manually.

install app installer using msixbundle file

Check the installed winget version using this command:

winget --version

check winget version

Here are the basic winget commands:

  • winget install <package> —install a package
  • winget uninstall <package> — remove package
  • winget upgrade – update software package
  • winget list – list installed apps on Windows
  • winget show <package> — display the package info
  • winget source <options> — manage repositories
  • winget search <search_string> — search for packages in repositories
  • winget export – export the list of installed programs to a file
  • winget import – installation of programs (packages) according to the list in the file
  • winget hash <package> — get a package installer hash
  • winget validate <package> — to validate a manifest file

winget options

The winget settings are stored in the settings.json file (C:\Users\%username%\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState). You can change Winget settings using the command:

winget settings

Deploying Software Packages in Windows using WinGet

Online repositories are used to install programs via the WinGet package manager. Their list can be displayed with the command:

winget source list

By default, there are two official repositories available in WinGet:

  • msstore (https://storeedgefd.dsx.mp.microsoft.com/v9.0) – Microsoft Store repository
  • winget (https://winget.azureedge.net/cache) – basic winget software repository maintained by Microsoft
You can connect third-party repositories in WinGet. You can add other sources using the command: winget source

Prior to installing an application via WinGet, you need to find out the package name. To search packages, the search command is used. For example, to search zip archive managers in the repository, run this command:

winget search zip

If you want to search for the program only in the Microsoft Store repository, run:

winget search zip -s msstore

The command returns the list of packages (with their names and versions) matching your query. Pay attention to the Source column. It lists the repository where the package is located.

winget search for app package

You can get information about a specific package:

winget show 7zip.7zip

winget show package properties

Multiple versions of a package can be hosted in the repository. In order to display a list of available package versions, run:

winget show 7zip.7zip --versions

For example, you want to install 7zip. Copy its name or ID and run the following installation command:

winget install 7zip.7zip

install 7zip from windows command uing winget

The latest available version of the program is installed by default. You can install a specific version of a package:

winget install 7zip.7zip -v 21.05

As you can see, the package manager has automatically downloaded and installed the app using a single command. The program has appeared in the list of installed software in the Windows Start menu.

newly installed software on windows 10

Then let’s install Windows Terminal and VSCode for PowerShell scripts.

Search the package names first:

winget search terminal
winget search "visual studio"

Then install them in turn:

winget install Microsoft.WindowsTerminal –e ; winget install Microsoft.VisualStudioCode –e

If you want to run the package installation in the background, use the –silent option:

winget install "VLC media player" --silent

When you install some software, you can automatically accept the terms of use. For example, when installing the Sysinternals toolkit:

winget install sysinternals --accept-package-agreements

By default, programs are installed on the system drive in the Program Files folders. You can change the installation folder for a program:

winget install microsoft.visualstudiocode --location "D:\Programs"

Please note that when running winget without administrator permissions, a UAC elevation prompt may appear when installing some programs. If you run winget in an elevated cmd/PowerShell console, all programs are installed without a UAC prompt (be careful, only install applications you trust).

Winstall: Web GUI for WinGet Package Manager

Users who don’t like the winget CLI interface can use the Winstall web service (https://winstall.app/). Winstall is a graphical interface for the WinGet repository (over 2900 programs are available for installation).

You can use Winstall to generate an installation script for the programs you need. Find programs in the repository and click + to add them to the installation script.

Winstall - web interface for winget app repository

Then click on the Generate Script button and the service will create a CLI command to install the selected app packages.

Copy the code from the Batch or PowerShell tab and paste it into cmd.exe or PowerShell console.

generate powershell/batch script to install multiple apps at once with winget

Thus, you can install the programs you need with just one command.

WinGet: Updating and Removing Packages on Windows

WinGet allows you to not only install programs but also update or remove them. To display a list of installed programs on your computer, run:

winget list

The command will display a complete list of programs installed on the computer (including programs not installed via winget). If an update is available for the program, the new version will be displayed in the Available column.

winget - updating packages, check available versions

To update an application installed via winget, run the commands:

winget upgrade --id 7zip.7zip

You can update all installed programs at once:

winget upgrade --all

To remove programs, use the command:

winget uninstall --name 7zip.7zip

You can also uninstall applications not installed via WinGet by their ID:

winget uninstall --id "{0F693AA3-4387-4ACB-A6FD-3A396290587}"

Export and Import Installed Software List to Another Computer via WinGet

With WinGet, you can export a list of programs installed on a computer to a JSON file and then use this file to quickly install (import) the same set of apps on another computer.

To export the list of installed apps to a JSON file, run:

winget export -o c:\ps\installedapps.json --include-versions

If there is no manifest for the program, then the command will display an error The installed package is not available in any source.

The file contains a list of programs installed through the Windows Package Manager.

export installed app list to json file with winget

To install a set of programs from a JSON file on another computer, run the command:

winget import -o .\installed_apps.json

Windows Package Manager can ignore versions and unavailable programs during installation by adding the --ignore-unavailable and --ignore-versions options.

1 comment
1
Facebook Twitter Google + Pinterest
previous post
Configuring Always-On High Availability Groups on SQL Server
next post
How to Connect and Manage Exchange Online with PowerShell

Related Reading

How to Connect VPN Before Windows Logon

November 14, 2023

Using WPAD (Web Proxy Auto-Discovery Protocol) on Windows

November 7, 2023

Send Emails with Microsoft Graph API and PowerShell

November 6, 2023

Zabbix: How to Get Data from PowerShell Scripts

October 27, 2023

Tracking Printer Usage with Windows Event Viewer Logs

October 19, 2023

1 comment

ksanger September 16, 2021 - 12:12 pm

Installation did not work.

Invoke-WebRequest : The request was aborted: The connection was closed unexpectedly.
At line:1 char:1
+ Invoke-WebRequest -Uri “https://github.com/microsoft/winget-cli/relea …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

PS C:\Windows\system32>

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • How to Connect VPN Before Windows Logon

    November 14, 2023
  • Removing Azure Arc Setup Feature on Windows Server 2022

    November 9, 2023
  • Using WPAD (Web Proxy Auto-Discovery Protocol) on Windows

    November 7, 2023
  • Send Emails with Microsoft Graph API and PowerShell

    November 6, 2023
  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Manage Windows Updates with PSWindowsUpdate PowerShell Module
  • Configuring Port Forwarding in Windows
  • Start Menu or Taskbar Search Not Working in Windows 10/11
  • Get-ADUser: Find Active Directory User Info with PowerShell
  • Adding Drivers into VMWare ESXi Installation Image
  • How to Hide Installed Programs in Windows 10 and 11
  • Configuring SFTP (SSH FTP) Server on Windows
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top