winget is the official command-line package manager for Windows, built and maintained by Microsoft. It handles searching, installing, upgrading, and removing applications directly from the terminal – no more downloading .exe files from random websites or clicking through installation wizards. With access to thousands of packages in the Windows Package Manager repository, winget brings the convenience of Linux package managers like apt and dnf to Windows.
This guide covers how to install and use winget on Windows 11 and Windows Server 2022/2025. You will learn how to search for packages, install and upgrade applications, export and import application lists for machine migration, customize winget settings, and automate package management with PowerShell scripts.
Prerequisites
Before you start, make sure your system meets these requirements:
- Windows 11 (any version) – winget is pre-installed via App Installer
- Windows 10 version 1809 (build 17763) or later – requires App Installer from the Microsoft Store
- Windows Server 2025 – winget is included out of the box
- Windows Server 2022 – requires manual installation (covered in Step 8)
- Administrator access for installing system-wide applications
- Internet connectivity to download packages from the winget repository
Step 1: Verify winget is Installed
On Windows 11 and Windows Server 2025, winget ships as part of the App Installer package and should be available immediately. Open PowerShell or Windows Terminal and check the installed version.
winget --version
The output shows the installed winget version. As of this writing, the latest stable release is v1.28:
v1.28.220
If winget is not recognized, the App Installer package may be missing or outdated. On Windows 10 and 11, update it from the Microsoft Store by searching for “App Installer” and clicking Update. Alternatively, download the latest .msixbundle from the winget-cli GitHub releases page.
To confirm winget is fully functional, run the info command to see configuration details:
winget --info
This displays your winget version, logs location, package sources, and admin settings path – useful for troubleshooting if something is not working.
Step 2: Search for Packages with winget
The winget search command lets you find available packages in the repository. winget searches across both the Microsoft community repository (winget) and the Microsoft Store (msstore) sources.
Search for an application by name:
winget search firefox
The results include the package name, ID, version, match type, and source:
Name Id Version Match Source
----------------------------------------------------------------------------------------------
Mozilla Firefox Mozilla.Firefox 137.0 Moniker: winget
Mozilla Firefox Beta Mozilla.Firefox.Beta 138.0b3 winget
Mozilla Firefox Nightly Mozilla.Firefox.Nightly 139.0a1 winget
Mozilla Firefox ESR Mozilla.Firefox.ESR 128.8.0 winget
Mozilla Firefox ESR 115 Mozilla.Firefox.ESR.115 115.21.0 winget
Firefox Browser 9NZVDKPMR9RD Unknown msstore
The Id column is what you use for installation. It uniquely identifies each package and avoids ambiguity when multiple packages share similar names.
You can also search by exact ID to narrow results:
winget search --id Microsoft.VisualStudioCode
To filter results from a specific source, use the --source flag:
winget search python --source winget
Step 3: Install Applications with winget
Install packages using the winget install command followed by the package ID. Using the full ID is recommended over the package name to avoid ambiguity.
winget install --id Mozilla.Firefox --source winget
winget downloads the installer and runs it silently. You will see a progress bar followed by a confirmation message when the installation completes successfully.
To install a specific version of a package, use the --version flag:
winget install --id Python.Python.3.12 --version 3.12.9 --source winget
For silent installations that skip all prompts and license agreements, add the --accept-package-agreements and --accept-source-agreements flags:
winget install --id 7zip.7zip --source winget --accept-package-agreements --accept-source-agreements
These flags are particularly useful in scripts and automated deployments where no one is at the keyboard to click Accept.
To install an application for all users on the machine (requires an elevated terminal), use the --scope flag:
winget install --id Notepad++.Notepad++ --scope machine --source winget
If you prefer to install for the current user only, set the scope to user instead.
Step 4: Upgrade Applications with winget
winget can detect outdated applications on your system and upgrade them. To list all packages with available updates, run:
winget upgrade
The output shows each installed package that has a newer version available, along with the current and available version numbers:
Name Id Version Available Source
------------------------------------------------------------------------------------
Git Git.Git 2.44.0 2.47.1 winget
Visual Studio Code Microsoft.VisualStudioCode 1.89.0 1.98.2 winget
Node.js LTS OpenJS.NodeJS.LTS 20.12.0 22.14.0 winget
Upgrade a specific package by its ID:
winget upgrade --id Git.Git --source winget
To upgrade everything at once, use the --all flag. This is the winget equivalent of apt upgrade on Linux – it updates every package that has a newer version:
winget upgrade --all --accept-package-agreements --accept-source-agreements
To skip a specific package during bulk upgrades (for example, if you need to stay on a specific version), pin it:
winget pin add --id Microsoft.VisualStudioCode
Pinned packages are excluded from winget upgrade --all until you remove the pin with winget pin remove --id Microsoft.VisualStudioCode.
Step 5: Uninstall Applications with winget
Remove installed applications using the winget uninstall command. This works for applications installed through winget and also for applications installed by other methods that are registered in Windows.
winget uninstall --id Mozilla.Firefox
winget runs the application’s uninstaller silently and confirms removal when done.
To see all applications currently installed on your system that winget can manage, run:
winget list
You can filter the list to find a specific application:
winget list --name "Visual Studio"
This is helpful when you need the exact package ID before running an uninstall command.
Step 6: Export and Import Application Lists
One of the most practical winget features is the ability to export your installed applications to a JSON file and import them on another machine. This is ideal for setting up new workstations, migrating between PCs, or standardizing developer environments across a team.
Export your current application list to a JSON file:
winget export -o C:\backup\my-apps.json
The exported file contains a JSON array of all winget-managed packages with their IDs, versions, and source information. You can review and edit this file to remove any packages you do not want on the new machine.
On the new machine, import and install all applications from the file:
winget import -i C:\backup\my-apps.json --accept-package-agreements --accept-source-agreements
winget processes each entry in the file and installs any packages that are not already present. Packages that are already installed are skipped. This makes the import command idempotent – safe to run multiple times without duplicating installations.
For team environments, you can maintain a shared JSON file in a Git repository that defines the standard set of development tools. New team members clone the repo and run a single import command to get their workstation configured.
Step 7: Configure winget Settings
winget stores its configuration in a JSON settings file that you can edit to customize behavior. Open the settings file in your default editor with:
winget settings
This opens the settings.json file located at %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json. Here is an example configuration with commonly adjusted settings:
{
"$schema": "https://aka.ms/winget-settings.schema.json",
"visual": {
"progressBar": "rainbow"
},
"installBehavior": {
"preferences": {
"scope": "machine",
"installerType": "msi"
}
},
"source": {
"autoUpdateIntervalInMinutes": 5
},
"telemetry": {
"disable": true
},
"network": {
"downloader": "wininet"
}
}
Key settings explained:
- visual.progressBar – controls the progress bar style. Options:
accent,rainbow,retro - installBehavior.preferences.scope – sets the default install scope to
machine(all users) oruser(current user only) - installBehavior.preferences.installerType – preferred installer format when multiple are available (msi, exe, msix)
- source.autoUpdateIntervalInMinutes – how often winget refreshes the package source index
- telemetry.disable – set to
trueto stop sending usage data to Microsoft - network.downloader – the download method. Options:
default,wininet,do(Delivery Optimization)
The full schema reference is available in the winget settings documentation.
Step 8: Use winget on Windows Server
winget support varies between Windows Server versions. Here is how to get it running on Server 2025 and Server 2022.
Windows Server 2025
winget is included in Windows Server 2025 out of the box. Open PowerShell as Administrator and it should be available immediately:
winget --version
If for any reason winget is not present, update the App Installer package from the Microsoft Store or download the latest release from GitHub.
Windows Server 2022 (Manual Installation)
Windows Server 2022 does not include winget by default. The installation requires downloading the App Installer package and its dependencies manually. Note that Microsoft considers winget on Server 2022 as unsupported – it works, but use it at your own discretion in production.
First, download the required dependencies and the App Installer package. Run these commands in an elevated PowerShell session:
Invoke-WebRequest -Uri "https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx" -OutFile "$env:TEMP\VCLibs.appx"
Add-AppxPackage -Path "$env:TEMP\VCLibs.appx"
Next, download and install the Microsoft.UI.Xaml dependency:
Invoke-WebRequest -Uri "https://github.com/nicehash/NiceHashQuickMiner/raw/main/nhpackages/Microsoft.UI.Xaml.2.8.x64.appx" -OutFile "$env:TEMP\UIXaml.appx"
Add-AppxPackage -Path "$env:TEMP\UIXaml.appx"
Now download and install the winget package itself. Get the latest .msixbundle from the GitHub releases page:
Invoke-WebRequest -Uri "https://github.com/microsoft/winget-cli/releases/latest/download/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" -OutFile "$env:TEMP\winget.msixbundle"
Add-AppxPackage -Path "$env:TEMP\winget.msixbundle"
After installation, close and reopen PowerShell, then verify winget is working:
winget --version
If the command is recognized and returns a version number, the installation was successful. You can now use all winget commands on your Server 2022 system.
Step 9: Automate with PowerShell Scripts
winget works well in PowerShell automation scripts for provisioning new workstations or keeping machines up to date. Below are practical examples you can use directly.
This script installs a standard set of development tools on a fresh Windows machine:
$apps = @(
"Git.Git",
"Microsoft.VisualStudioCode",
"OpenJS.NodeJS.LTS",
"Python.Python.3.12",
"7zip.7zip",
"Mozilla.Firefox",
"Docker.DockerDesktop",
"Microsoft.WindowsTerminal"
)
foreach ($app in $apps) {
Write-Host "Installing $app..." -ForegroundColor Cyan
winget install --id $app --source winget --accept-package-agreements --accept-source-agreements --silent
if ($LASTEXITCODE -eq 0) {
Write-Host "$app installed successfully." -ForegroundColor Green
} else {
Write-Host "Failed to install $app. Exit code: $LASTEXITCODE" -ForegroundColor Red
}
}
Save this as setup-dev-tools.ps1 and run it from an elevated PowerShell session. The script iterates through the list, installs each application silently, and reports success or failure for each one.
For scheduled upgrades, create a script that updates all installed packages and logs the results:
$logFile = "C:\logs\winget-upgrade-$(Get-Date -Format 'yyyy-MM-dd').log"
New-Item -Path (Split-Path $logFile) -ItemType Directory -Force | Out-Null
Write-Output "winget upgrade started at $(Get-Date)" | Tee-Object -FilePath $logFile -Append
winget upgrade --all --accept-package-agreements --accept-source-agreements 2>&1 | Tee-Object -FilePath $logFile -Append
Write-Output "winget upgrade completed at $(Get-Date)" | Tee-Object -FilePath $logFile -Append
Save this as upgrade-all.ps1 and schedule it with Task Scheduler to run weekly. The log file captures all upgrade output for auditing.
You can also use winget with the Microsoft.WinGet.Client PowerShell module for deeper integration. Install the module first:
Install-Module -Name Microsoft.WinGet.Client -Force
Then use PowerShell cmdlets instead of the CLI:
Get-WinGetPackage | Where-Object IsUpdateAvailable -eq $true
The PowerShell module returns structured objects instead of text output, making it easier to filter, sort, and pipe results into other commands.
Essential winget Commands Reference
This table covers the most commonly used winget commands for quick reference:
| Command | Description |
|---|---|
winget search <query> | Search for packages by name or ID |
winget install --id <ID> | Install a package by its unique ID |
winget upgrade | List all packages with available updates |
winget upgrade --all | Upgrade all outdated packages at once |
winget upgrade --id <ID> | Upgrade a specific package |
winget uninstall --id <ID> | Remove an installed package |
winget list | List all installed packages |
winget show --id <ID> | Show detailed info about a package |
winget export -o <file> | Export installed packages to a JSON file |
winget import -i <file> | Install packages from an exported JSON file |
winget pin add --id <ID> | Pin a package to skip during bulk upgrades |
winget pin remove --id <ID> | Remove a pin to allow upgrades again |
winget settings | Open the winget settings JSON file |
winget source list | List configured package sources |
winget source update | Refresh the package source index |
Conclusion
winget is a solid package manager that finally gives Windows a native command-line tool for managing applications. With the commands covered in this guide – installing apps from the command line, upgrading, exporting configurations for migration, and scripting deployments – you can manage software across Windows 11 desktops and Windows Server machines efficiently.
For production server environments, combine winget with Group Policy or configuration management tools like Terraform to enforce consistent application versions across your fleet. Keep your packages updated regularly and use the export/import feature to maintain reproducible machine setups.