Winget (Windows Package Manager) is a command-line tool that simplifies the process of discovering, installing, upgrading, removing, and configuring applications on Windows 10, Windows 11, and Windows Server 2025. It’s often compared to package managers like apt on Linux or Homebrew on macOS. Winget is also a great alternative to online batch installers like Ninite .
Here’s a comprehensive reference guide to using Winget:
I. Installation and Prerequisites
- Availability: WinGet is included as part of the App Installer component in recent Windows versions. Most users will already have it. You can check its availability by opening a Command Prompt or PowerShell and typing winget –info.
- Manual Installation: If you don’t have Store access, you can download the Microsoft.DesktopAppInstaller_*.msixbundle and its dependency packages from the official GitHub releases and install them manually.
- Requirements: Winget requires 64-bit Windows 10 version 1709 or later. PowerShell 5 or Windows Terminal is recommended for better command-line experience.
- Administrator Privileges: While some installations can be done without administrator privileges (Windows will prompt for elevation), running Winget in an Administrator Command Prompt or PowerShell is often necessary for seamless installations and upgrades.
II. Core Commands
Here are the most used Winget commands:
- winget –help: Displays a list of all available commands and general usage information.
- winget <command> –help: Provides detailed help for a specific command (e.g., winget install –help).
- winget search <query>: Searches for available packages based on a given query (ID, name, description, or tags).
- Example: winget search “Google Chrome”
- winget show <package_id>: Displays detailed information about a specific package, including version, publisher, switches, and links.
- Example: winget show Google.Chrome
- winget install <package_id>: Installs the specified package silently by default.
- Example: winget install Microsoft.PowerToys
- Silent vs. Interactive: Use –interactive if you want to see the installer UI and interact with it.
- Accept Agreements: For automated installations, you might need to use –accept-package-agreements and –accept-source-agreements.
- Specific Version: winget install <package_id> –version <version_number>
- From Source: winget install <package_id> –source <source_name>
- Scope: winget install -g <package_name> or winget install –scope machine (for all users).
- winget list: Lists all installed applications on your machine, including those not installed via Winget. This can help identify applications that have available updates through Winget.
- winget upgrade: Lists all available updates for installed applications.
- winget upgrade <package_id>: Upgrades a single specified package to its latest available version.
- Example: winget upgrade VLC.VLCmediaPlayer
- winget upgrade –all: Upgrades all applications for which Winget finds an update.
- winget upgrade –all –include-unknown: Upgrades all applications, including those that Winget didn’t originally install.
- winget uninstall <package_id>: Uninstalls the specified package.
- Example: winget uninstall Spotify.Spotify
- winget export -o <filename.json>: Exports a list of currently installed packages to a JSON file. This is useful for replicating your software environment on other machines.
- Example: winget export -o my_apps.json
- winget import <filename.json>: Imports a list of packages from a JSON file and installs them.
- Example: winget import my_apps.json
- Accept Agreements on Import: winget import <filename.json> –accept-package-agreements –accept-source-agreements
- winget pin: Manages package pins, which allow you to lock a package to a specific version and prevent it from being upgraded.
- winget pin add –id <Id> –version <v>: Locks the package.
- winget pin remove –id <Id>: Unlocks the package.
- winget pin list: Lists all pinned packages.
- winget configure: Allows you to configure your system into a desired state using YAML-based configuration files. This is a powerful feature for automating machine setup.
- Example: winget configure –file dev_setup.yml
- winget source: Manages the sources (repositories) from which Winget fetches packages.
- winget source list: Lists currently configured sources.
- winget source add –name <name> –arg <url>: Adds a new source.
- winget source remove –name <name>: Removes a source.
- winget source update: Updates all registered sources.
- winget hash: Generates the SHA256 hash for an installer, which is used in manifest files for security verification.
- winget validate <manifest_file>: Validates a manifest file to ensure it’s correctly formatted.
- winget download: Downloads the specified application’s installer without installing it.
III. Advanced Usage and Best Practices
- Silent Installation: By default, winget install attempts a silent installation. If an installer requires user interaction, it might fail or prompt you.
- Error Handling: If an installation or upgrade fails, Winget will usually provide an error message. Common issues include network problems, permission issues (run as administrator), or partial upgrades. You can also use winget –log to view detailed logs.
- Automating Updates: While Winget doesn’t have built-in automatic updates, you can schedule tasks using Windows Task Scheduler to run winget upgrade –all –silent regularly.
- Private Feeds: Organizations can host their own private Winget feeds for internal tools, allowing for centralized management of proprietary software.
- Security: Winget employs hash verification to ensure installer integrity and leverages Windows SmartScreen reputation checks.
- Group Policy: Administrators can use Group Policy to control Winget behavior, such as blocking experimental features, forcing elevation, or restricting allowed sources.
- Scripting: Winget commands are highly scriptable, making it an excellent tool for automated deployments, golden image maintenance, and CI/CD pipelines.
- Manifest Files: Package information (metadata, installer URLs, silent switches, dependencies, etc.) is stored in YAML-formatted “manifest” files in the Winget community repository or private sources.
- Coexistence with Other Package Managers: Winget can coexist with other package managers like Chocolatey or Scoop. They each have their strengths and can be used for different types of software.
- Explicit Scripts: When creating automation scripts, use full package IDs and version pins for stability, especially in production environments.
- Version Control: Treat exported package lists and configuration files as code and store them in version control systems (e.g., Git).
- Testing: Test new versions of applications in a test environment before deploying them widely.
IV. Resources for Further Learning
- GitHub Repository: The microsoft/winget-cli GitHub repository is where the Winget client source code is hosted, and you can find issues, discussions, and the latest releases there.
- winget.run: A community-driven website that simplifies finding Winget packages.
V. Batch File Example
Below is a use batch file for installing some very great applications
@echo off
echo Starting application installation using winget…
echo.
REM Update Winget sources
echo Updating winget sources…
winget source update
echo.
REM Install Microsoft Office (365)
echo Installing Microsoft Office…
winget install –id Microsoft.Office -e
echo.
REM Install Google Chrome
echo Installing Google Chrome…
winget install –id Google.Chrome -e
echo.
REM Install Mozilla Firefox
echo Installing Mozilla Firefox…
winget install –id Mozilla.Firefox -e
echo.
REM Install 7-Zip
echo Installing 7-Zip…
winget install –id 7zip.7zip -e
echo.
REM Install Dropbox
echo Installing Dropbox…
winget install –id Dropbox.Dropbox -e
echo.
echo All installations attempted. Check for any errors above.
pause
VI Conclusion
Learning to use the Winget command will make it a lot easier to install/upgrade and uninstall software.
Checkout Use WinGet to install and manage applications | Microsoft Learn if you want additional information on Winget