Skip to main content
Home/Blog/Automation/winget Commands: Install, Upgrade and Manage Apps (2026)
Automation

winget Commands: Install, Upgrade and Manage Apps (2026)

Install, upgrade and manage Windows apps from the command line with winget. Complete 2026 reference for winget install, winget upgrade --all, search, export and silent automation.

By InventiveHQ Team
winget Commands: Install, Upgrade and Manage Apps (2026)

Need to install or update Windows apps from the command line? This guide covers every winget search, install, upgrade, uninstall, export, and import command — including silent automation, exact matches, and version pinning — for Windows 10, 11, and Server.

winget Command Builder

Build Windows Package Manager (winget) commands to search, install, upgrade, uninstall, and export apps — with exact-match, silent, version, and scope flags.

Open the full winget Command Builder
Loading interactive tool...

Verified June 2026 · tested with winget 1.9 on Windows 11 24H2, Windows 10 22H2 & Server 2022/2025


Quick Reference: Essential Commands

Need to manage an app right now? Here are the most common commands:

# Find a package and its ID
winget search firefox

# Install an exact package by ID
winget install -e --id Mozilla.Firefox

# List installed apps that have an update available
winget upgrade

# Upgrade everything, unattended
winget upgrade --all --silent --accept-source-agreements --accept-package-agreements

# Remove an app
winget uninstall -e --id Mozilla.Firefox

# Save and restore your whole app set
winget export -o apps.json
winget import -i apps.json

Which command do you need?

Jump to the section you need below.


winget search: Find Packages

winget search queries the configured sources (by default the winget community repository and the msstore Microsoft Store) and returns matching packages with the Id you'll use for everything else.

Windows 10 1809+Windows 11Server 2022+Built in (App Installer)

winget search Option Reference

OptionDescription
<query>Free-text term matched against name, ID, moniker and tags
--id <id>Match against the package Id only
--name <name>Match against the package Name only
--moniker <m>Match against the short moniker (e.g. vscode)
-e, --exactRequire an exact, case-sensitive match
--source <name>Search a single source (winget or msstore)
--count <n>Limit the number of results shown

winget search Usage Examples

# Broad search across name, ID, moniker and tags
winget search "visual studio code"

# Find the exact ID of a known package
winget search --id Microsoft.PowerToys

# Search only the Microsoft Store source
winget search spotify --source msstore

# Narrow a noisy term to the first 10 hits
winget search node --count 10

Tip: The value in the Id column (for example Microsoft.VisualStudioCode) is stable across versions. Always grab the ID from winget search, then use it with -e --id so later commands hit the exact package.


winget install: Install Packages

winget install downloads and runs a package's installer. Pair it with -e --id for a precise, repeatable install, and add --silent for unattended scripts.

Windows 10 1809+Windows 11Server 2022+Per-user & per-machine

winget install Option Reference

OptionDescription
-e, --exactExact, case-sensitive match on ID/name (avoids ambiguous results)
--id <id>Install by package Id (most reliable selector)
--name <name>Install by package Name
-v, --version <ver>Install a specific version instead of the latest
--silent, -hSuppress the installer UI (requires silent support in the manifest)
--interactive, -iForce the installer's interactive UI
--source <name>Install from a specific source (winget or msstore)
--scope {user|machine}Install per-user or system-wide (where the installer supports it)
--location <path>Override the install directory (if the installer allows it)
--override <args>Pass a raw argument string straight to the installer
--accept-package-agreementsAuto-accept the package's license (for scripts)
--accept-source-agreementsAuto-accept source terms on first use (for scripts)

winget install Usage Examples

# Reliable, exact install by ID
winget install -e --id Mozilla.Firefox

# Silent, fully unattended (good for scripts and imaging)
winget install -e --id Google.Chrome --silent --accept-package-agreements --accept-source-agreements

# Pin a specific version
winget install -e --id Git.Git --version 2.44.0

# Force a system-wide (per-machine) install
winget install -e --id 7zip.7zip --scope machine

# Install from the Microsoft Store source
winget install -e --id 9NCBCSZSJRSB --source msstore

Tip: A bare winget install firefox can match several packages and prompt you to choose. In automation, always use -e --id so the command never stops to ask which package you meant.


winget list: Show Installed Packages

winget list enumerates everything installed on the machine — not just apps installed through winget. It cross-references each entry against winget's sources to show whether a newer version is available.

Windows 10 1809+Windows 11Server 2022+All installers, not just winget

winget list Option Reference

OptionDescription
<query>Filter the installed list by a search term
--id <id>Filter by package Id
--name <name>Filter by package Name
-e, --exactRequire an exact match on the filter
--source <name>Only show packages tied to a given source
--upgrade-availableShow only packages that have an update available

winget list Usage Examples

# Everything installed on the machine
winget list

# Is a specific app installed, and what version?
winget list --id Microsoft.PowerToys

# Show only apps with an update waiting
winget list --upgrade-available

Note: Entries whose version winget can't determine show Unknown in the Version column. Those apps are typically managed outside winget (portable apps, custom installers) and may not be upgradeable through it.


winget upgrade: Update Packages

winget upgrade (alias winget update) with no arguments lists every installed package that has a newer version available. Add a package selector to update one app, or --all to update everything.

Windows 10 1809+Windows 11Server 2022+Alias: winget update

winget upgrade Option Reference

OptionDescription
(no args)List packages with an available upgrade
-e --id <id>Upgrade one specific package
--all, -rUpgrade every package with an available update
--include-unknown, -uAlso upgrade apps whose installed version is Unknown
--include-pinnedInclude pinned packages in the upgrade
--silent, -hSuppress installer UIs during the upgrade
--accept-package-agreementsAuto-accept package licenses (for scripts)
--accept-source-agreementsAuto-accept source terms (for scripts)

winget upgrade Usage Examples

# What can be updated?
winget upgrade

# Update one app
winget upgrade -e --id Microsoft.VisualStudioCode

# Update everything, interactively
winget upgrade --all

# Update everything, fully unattended (ideal for a scheduled task)
winget upgrade --all --silent --accept-source-agreements --accept-package-agreements

# Also catch apps whose version winget couldn't detect
winget upgrade --all --include-unknown --silent --accept-source-agreements --accept-package-agreements

Automate it with a scheduled task. Run a weekly silent upgrade of every app with no interaction:

# Create a SYSTEM scheduled task that runs winget upgrade --all every Sunday at 3 AM
$action  = New-ScheduledTaskAction -Execute "winget" `
    -Argument "upgrade --all --silent --accept-source-agreements --accept-package-agreements"
$trigger = New-ScheduledTaskTrigger -Weekly -DaysOfWeek Sunday -At 3am
Register-ScheduledTask -TaskName "Winget Weekly Upgrade" `
    -Action $action -Trigger $trigger -User "SYSTEM" -RunLevel Highest

Warning: winget upgrade --all upgrades every matched app in one pass, including browsers and tools that may be in active use. Installers can close running apps without warning, and major version jumps can introduce breaking changes. Test on a pilot machine before scheduling --all --silent across a fleet, and review the upgrade list (winget upgrade) before running it broadly.


winget uninstall: Remove Packages

winget uninstall (alias winget remove) removes an installed package. As with install, use -e --id so you remove exactly the app you mean.

Windows 10 1809+Windows 11Server 2022+⚠ Removes software

winget uninstall Option Reference

OptionDescription
-e, --exactExact, case-sensitive match (avoid removing the wrong app)
--id <id>Uninstall by package Id
--name <name>Uninstall by package Name
-v, --version <ver>Target a specific installed version
--silent, -hSuppress the uninstaller UI
--purgeAlso delete files left in the package's install directory (portable packages)
--all-versionsRemove every installed version of the package

winget uninstall Usage Examples

# Remove an app by exact ID
winget uninstall -e --id Mozilla.Firefox

# Silent removal for scripts
winget uninstall -e --id Notepad++.Notepad++ --silent

# Remove a portable app and clean up its folder
winget uninstall -e --id sharkdp.bat --purge

Warning: winget uninstall permanently removes the application and, with --purge, deletes files left in its install directory. There is no undo. Double-check the Id with winget list before running uninstall in a script, and never pipe an unfiltered list into uninstall.


winget show: Inspect a Package

winget show prints full metadata for a single package — publisher, description, homepage, installer type, and (with --versions) every version winget can install. It downloads nothing.

Windows 10 1809+Windows 11Read-only — installs nothing

winget show Option Reference

OptionDescription
<query> / --id / --nameSelect the package to inspect
-e, --exactRequire an exact match
--versionsList all available versions instead of details
-v, --version <ver>Show metadata for one specific version
--source <name>Inspect the package from a specific source

winget show Usage Examples

# Full details about a package
winget show -e --id Git.Git

# List every version you could install
winget show -e --id Git.Git --versions

# Inspect a single version
winget show -e --id Git.Git --version 2.44.0

Tip: Run winget show --id <id> --versions before a --version install or a version-pinned deployment so you only request versions winget actually has manifests for.


winget source: Manage Package Sources

A source is a repository winget pulls packages from. Two ship by default: winget (the community repository) and msstore (the Microsoft Store). winget source lists, adds, refreshes, and resets them.

Default: winget + msstoreSupports private/internal sources

winget source Subcommand Reference

SubcommandDescription
listShow configured sources and their URLs
add --name <n> --arg <url>Add a source (e.g. an internal REST repository)
updateRefresh the local cache of one or all sources
remove --name <n>Remove a configured source
resetReset sources back to defaults (prompts for confirmation)

winget source Usage Examples

# List configured sources
winget source list

# Refresh the source index (do this if search returns stale results)
winget source update

# Add a private internal REST source
winget source add --name corp --arg https://winget.corp.local --type Microsoft.Rest

# Reset all sources back to defaults
winget source reset --force

Warning: winget source reset --force removes every custom source and restores only the defaults without prompting. If you rely on an internal/private repository, record its name and URL (winget source list) before resetting so you can re-add it afterward.


winget export & import: Migrate Your App Set

winget export writes every installed package that has a known winget Id to a JSON manifest; winget import reinstalls them from that file. Together they're the fastest way to rebuild a machine or standardize a baseline.

JSON manifestGreat for reimagingSkips apps with no winget source

export / import Option Reference

OptionCommandDescription
-o, --output <file>exportPath to write the JSON manifest
--include-versionsexportRecord the exact installed version of each app
--source <name>exportOnly export packages from a given source
-i, --import-file <file>importPath to the JSON manifest to install from
--ignore-unavailableimportSkip packages no longer in the source instead of failing
--ignore-versionsimportInstall the latest version even if a version is pinned in the file
--accept-package-agreementsimportAuto-accept licenses (for unattended setup)

export / import Usage Examples

# Export every installed app with a known winget ID
winget export -o apps.json

# Export and pin the exact versions currently installed
winget export -o apps.json --include-versions

# Reinstall the whole set on a new machine, unattended
winget import -i apps.json --accept-package-agreements --accept-source-agreements

# Import but skip anything no longer available in the source
winget import -i apps.json --ignore-unavailable

Note: Export only captures apps that map to a winget source entry. Apps installed manually or from sources winget doesn't know about are omitted from the JSON — review the file before relying on it as a complete machine baseline.


Troubleshooting: Common winget Errors

Each row is deep-linkable — share a specific error with …#wg-no-applicable, and the row highlights on arrival.

Error / SymptomMeaningFix
'winget' is not recognizedApp Installer is missing or not on PATHInstall App Installer from the Microsoft Store, or update Windows; on Server install the App Installer package manually
No applicable installer foundNo installer matches the machine's architecture/scope/localeCheck the package supports your CPU (x64/ARM64); try without --scope or use --architecture
No package found matching input criteriaThe query/ID didn't match anything in the sourcesRun winget search to confirm the exact Id, then winget source update
Multiple packages found matching inputThe term matched more than one packageRe-run with -e --id <exact-id> to disambiguate
Hangs waiting on a license/source promptScript ran without accepting agreementsAdd --accept-source-agreements --accept-package-agreements
App shows Unknown / missing from upgradewinget can't read the installed versionRun winget upgrade --include-unknown; some apps still can't be upgraded by winget
Installer hash does not matchDownloaded installer differs from the manifest hashRetry (partial download); if it persists the manifest is outdated — wait or use --ignore-security-hash with caution
access is denied on a per-machine installPer-machine install needs elevationRun the terminal as Administrator, or drop --scope machine for a per-user install

Version & Compatibility Notes

  • winget ships in App Installer. It's preinstalled on Windows 11 and on Windows 10 1809+ once App Installer updates from the Microsoft Store. Check your version with winget --version.
  • Windows Server: winget is not included by default on Server 2019/2022. Install the App Installer package (and its dependencies) manually, or use the Server 2025 build where it's more readily available. Source: Microsoft's winget-cli releases on GitHub.
  • winget update is an alias for winget upgrade — both accept the same options, including --all.
  • --silent depends on the installer. winget can only run an installer silently if the package manifest declares a silent switch. Some installers ignore --silent and still show UI.
  • -h vs --silent: older docs use -h (the short form) for silent installs; --silent is the current, clearer spelling and is preferred in scripts.
  • Group Policy / Intune: in managed environments, winget behavior (allowed sources, the Store) can be restricted by policy. If msstore is blocked, fall back to --source winget for community packages.
  • Configuration files: winget configure (the Microsoft.WinGet.Configuration feature) can apply a full machine setup from a YAML/DSC file — a step beyond import for repeatable provisioning.

Frequently Asked Questions

Find answers to common questions

Run 'winget upgrade --all' from a terminal to upgrade every package that has a newer version available. To do it unattended with no installer prompts, add the silent flag: 'winget upgrade --all --silent --accept-source-agreements --accept-package-agreements'. Packages installed outside of winget (or that pin their version) may be skipped — run 'winget upgrade --include-unknown' to also list apps whose installed version winget can't detect.

'winget install' downloads and installs a package for the first time (or installs a specific older/newer version with --version). 'winget upgrade' only updates a package that is already installed to a newer version. If you run 'winget install' on an app that's already present, winget will tell you it's already installed unless a newer version exists.

Add the -e (or --exact) flag, which forces an exact, case-sensitive match on the ID or name: 'winget install -e --id Mozilla.Firefox'. Pairing -e with --id is the most reliable way to install the precise app you mean, because a bare 'winget install firefox' can match multiple results and prompt you to disambiguate.

Use '--silent' (or '-h' for the legacy short form) to suppress the installer UI: 'winget install -e --id Google.Chrome --silent'. To also skip the source and license prompts in scripts, add '--accept-source-agreements --accept-package-agreements'. Note that --silent only works if the package's installer supports a silent mode in its manifest.

Use the --version flag with the exact version string: 'winget install -e --id Git.Git --version 2.44.0'. Run 'winget show --id Git.Git --versions' first to list every version winget can install for that package.

Run 'winget search ' to list matching packages with their IDs, or 'winget show ' for full details about one package including its publisher, available versions and installer type. Use the value in the 'Id' column (for example 'Microsoft.PowerToys') with -e --id for a precise install.

On the source machine run 'winget export -o apps.json' to write every installed package with a known winget ID to a JSON file. On the new machine run 'winget import -i apps.json' to reinstall them in one pass. Add '--accept-package-agreements --accept-source-agreements' to the import for unattended setup; apps without a winget source entry are skipped.

winget only lists upgrades for packages it can match to a known version in its sources. Apps installed outside winget, portable apps, or installers that don't report a version show as 'unknown' and are hidden by default. Run 'winget upgrade --include-unknown' to surface them, though winget may not be able to upgrade every one.

Transform Your IT with Automation

Streamline operations, reduce manual tasks, and improve security with intelligent automation.