Windows Package Manager winget — Complete Guide : Install, Upgrade & Automate

winget is Microsoft’s official command-line package manager for Windows. Instead of hunting for installers on websites and clicking through wizards, you can search, install, upgrade, and remove apps with a single command. It’s fast, script-friendly, and perfect for keeping development and productivity tools consistent across machines.

Advertisements

What is winget ?

Windows Package Manager (the tool is called winget) brings package management to Windows in a way that will feel familiar if you’ve used Linux’s apt or macOS’s brew. It pulls software from multiple sources—like the Windows Package Manager Community Repository and the Microsoft Store—and exposes a unified, predictable command set.

  • Simplified installs: One command replaces manual downloads and click-through installers.
  • Version control: Install a specific version or safely upgrade later.
  • Multiple sources: Community repository, Microsoft Store, and any additional repositories you configure.
  • Automation-ready: Silent installs, easy scripting, and export/import of app lists.
  • Consistency: Manage classic desktop apps and Store apps from one CLI.
Advertisements

Prerequisites quick check

winget ships with modern Windows via the “App Installer” package. To confirm it’s available:

winget --version

If the command isn’t recognized, install/update App Installer from the Microsoft Store, then reopen your terminal.

Advertisements

winget Basics: Everyday Commands You’ll Actually Use

winget is the Windows Package Manager. These core commands cover 90% of daily app management—discover, install, update, and remove—without opening a browser.

Check your installation

winget --version

Confirms that Windows Package Manager is installed (via “App Installer”). If it’s not recognized, install/update App Installer from Microsoft Store, then reopen your terminal.

Search for apps

Finds matching packages across configured sources (Community repository, Microsoft Store, etc.). Use quotes for multi-word names.

winget search <package-name> # Example: winget search "Visual Studio Code"
Advertisements

Inspect details before installing

winget show <package-id> # Example: winget show Microsoft.VisualStudioCode

Shows the exact Id, available versions, installer types (EXE/MSI/MSIX), and silent switches. Use the Id for reliable installs.

Install an app

winget install <package-id> # Example: winget install Git.Git

Installs the latest version from your sources. To pin a version: –version 2.44.0. For automation, add –silent –accept-package-agreements –accept-source-agreements.

List installed apps (known to winget)

winget list

Displays packages winget can see and manage. Some older apps may not appear if they weren’t installed through recognized channels.

Advertisements

Upgrade software

# Upgrade everything with updates available winget upgrade --all
winget upgrade Git.Git

Keep your toolbox current. If an app is running, close it first to avoid upgrade failures.

Uninstall an app

winget uninstall <package-id> # Example: winget uninstall Microsoft.VisualStudioCode

Removes the selected package using its registered uninstaller. If multiple entries exist, specify the exact Id from winget list.

Advertisements

Pro Tips

  • Prefer Ids over names: Git.Git beats “Git for Windows” for accuracy.
  • Script it: Use –silent and the two –accept-* flags in CI or setup scripts.
  • Speed up new PC setup: Export your stack once, then import on fresh machines:
winget export --output .\apps.json winget import --import-file .\apps.json --accept-package-agreements --accept-source-agreements
  • Know your sources: winget source list shows where packages come from (Community repository, Microsoft Store, etc.).

Bottom line: With these commands, you can install, audit, update, and remove most apps on Windows—no download pages required.

Advertisements

winget Advanced: Version Pinning, Silent Installs, Sources & Settings

Once you’re comfortable with the basics, these four commands unlock repeatable, script-friendly installs and tighter control over where packages come from and how they’re configured.

Install a specific version

Use –version when you need an exact build for compatibility or CI reproducibility.

winget install <package-id> --version <version> # Examples winget install OpenJS.NodeJS.LTS --version 20.19.0 winget install Git.Git --version 2.44.0
  • When to pin: legacy projects, matching team environments, or verifying a bug against a known version.
  • Tip: get the valid versions list with winget show.

Run silent, unattended installs

For scripts and automated setups, silence prompts so the install completes without interaction.

winget install <package-id> --silent --accept-package-agreements --accept-source-agreements # Example winget install Microsoft.VisualStudioCode --silent --accept-package-agreements --accept-source-agreements
  • Note: not every installer supports fully silent switches; check winget show to see installer type (EXE/MSI/MSIX) and behavior.
  • Admin rights: some packages elevate automatically; if it fails, run your terminal as Administrator.
Advertisements

See (and trust) your sources

Know where packages originate and keep repositories healthy.

winget source list # Common outputs: # winget <Windows Package Manager Community Repository> # msstore <Microsoft Store>
  • Update / reset sources:
winget source update winget source reset --force

Why it matters: clear provenance reduces surprises (e.g., Store vs Community repository), especially in enterprises.

Advertisements

Open and edit winget settings (JSON)

Customize defaults—great for teams and repeatable builds.

winget settings

That opens a JSON file. Here’s a minimal example you can adapt:

{ "$schema": "https://aka.ms/winget-settings.schema.json", "installBehavior": { "preferences": { "scope": "machine", // "user" or "machine" "locale": "en-US" }, "skipDependencies": false, "disableInstallNotes": true }, "network": { "downloader": "default" // or "WinINet", "DeliveryOptimization" }, "telemetry": { "disable": false }, "visual": { "progressBar": "rainbow" // "accent", "retro", etc. } }

Putting it all together (script-ready examples)

Pin and install a toolchain silently:

winget install Git.Git --version 2.44.0 --silent --accept-package-agreements --accept-source-agreements winget install Microsoft.VisualStudioCode --version 1.93.0 --silent --accept-package-agreements --accept-source-agreements winget install CoreyButler.NVMforWindows --silent --accept-package-agreements --accept-source-agreements

Export and re-create your stack on a new PC:

# On your primary machine winget export --output .\my-dev-stack.json
Advertisements

Install NVM for Windows and Pin a Specific Node.js Version with winget

The fastest way to manage Node.js on Windows is to combine two tools: winget (Microsoft’s package manager) to install software, and NVM for Windows (Node Version Manager) to keep multiple Node versions and switch between them on demand. Below is a practical, copy-ready flow you can run in PowerShell.

Discover and inspect the NVM package

First, confirm that winget can find the package and show its details (ID, available versions, installer type, etc.).

winget search nvm # Find Node Version Manager (NVM)Windows
winget show CoreyButler.NVMforWindows # Inspect the exact package (recommended: use the Id for installs)
Advertisements

Install NVM for Windows via winget

Use winget to install NVM silently and accept license prompts (handy for automation). If you’d rather click through an installer, omit the flags.

winget install CoreyButler.NVMforWindows --silent ^ --accept-package-agreements --accept-source-agreements

When the install finishes, open a new PowerShell window so your PATH changes take effect.

Install a specific Node.js version with winget

winget can install Node directly, including a pinned version. This is useful if you simply want one fixed Node version (no switching).

winget install OpenJS.NodeJS --version 22.19.0 # Example: install a specific Node.js version