Install Winget Using Powershell Updated [best] May 2026

Installing WinGet (Windows Package Manager) via PowerShell is the most efficient way to skip the Microsoft Store and automate your setup.

While modern Windows versions usually include it, you can force-install or repair it with these updated methods. 1. The Quick "One-Liner" (GitHub Release)

This script fetches the latest version directly from Microsoft’s GitHub and installs it. Open PowerShell as Administrator and run: powershell

$url = (Invoke-RestMethod https://api.github.com/repos/microsoft/winget-cli/releases/latest).assets.browser_download_url | Where-Object $_.EndsWith(".msixbundle") Invoke-WebRequest -Uri $url -OutFile "winget.msixbundle" Add-AppxPackage -Path "winget.msixbundle" Remove-Item "winget.msixbundle" Use code with caution. Copied to clipboard 2. The Official "Repair" Method

If you have the Microsoft.WinGet.Client module, you can use the official "bootstrap" command to install or fix WinGet for all users: powershell

Install-Module -Name Microsoft.WinGet.Client -Force -Repository PSGallery Repair-WinGetPackageManager -AllUsers Use code with caution. Copied to clipboard 3. The "Missing Dependencies" Fix

On older Windows 10 builds, WinGet might fail because it needs specific UI frameworks. Use this if the standard install doesn't work: powershell

# 1. Install VC++ Runtime Invoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile VCLibs.appx Add-AppxPackage VCLibs.appx # 2. Install UI Xaml 2.8 (Required for newer WinGet) Add-AppxPackage -Path https://cdn.winget.microsoft.com/cache/source.msix Use code with caution. Copied to clipboard Quick Verification Once installed, verify it by typing: powershell winget --version Use code with caution. Copied to clipboard install winget using powershell updated

If you get an error that the command isn't recognized, you might need to enable its App execution alias in Settings > Apps > App execution aliases. Helpful "Interesting" Commands

Now that you have it, here is what makes WinGet "interesting":

Update Everything: winget upgrade --all — Updates all your installed apps at once.

Export Your Setup: winget export -o myapps.json — Saves a list of all your apps to a file.

Import on a New PC: winget import -i myapps.json — Reinstalls all those apps on a fresh Windows install automatically.

Use WinGet to install and manage applications | Microsoft Learn

To install and update (Windows Package Manager) using PowerShell, use the official Microsoft.WinGet.Client Method 2: Extract and install from

. This is the most reliable method for modern systems, including Windows 10, 11, and Windows Sandbox Microsoft Learn 🛠️ Quick Installation (The "Modern" Way) Run these commands in an Administrative PowerShell Install the WinGet Client module: powershell

Install-Module -Name Microsoft.WinGet.Client -Force -Repository PSGallery Use code with caution. Copied to clipboard Bootstrap/Repair the WinGet executable: powershell Repair-WinGetPackageManager -AllUsers Use code with caution. Copied to clipboard Verify the installation: powershell winget --version Use code with caution. Copied to clipboard 📦 Alternative Manual Method (Direct Download)

If the module method fails or you are on a restricted system, you can manually download and install the package bundle directly from Microsoft's servers Stack Overflow powershell # Download the latest bundle Invoke-WebRequest -Uri "https://aka.ms/getwinget" "winget.msixbundle" # Install the package Add-AppxPackage winget.msixbundle # Clean up Remove-Item winget.msixbundle Use code with caution. Copied to clipboard 🔄 How to Update WinGet WinGet typically updates itself via the Microsoft Store

(as the "App Installer"). However, you can force an update through PowerShell Update All Apps (Including WinGet): powershell winget upgrade --all Use code with caution. Copied to clipboard Update via PowerShell Module: If you used the Microsoft.WinGet.Client

module, simply run the repair command again to pull the latest stable version: powershell Repair-WinGetPackageManager Use code with caution. Copied to clipboard ⚠️ Common Troubleshooting Missing Dependencies: On older systems or Windows Server, WinGet requires Microsoft UI Xaml Microsoft Learn Repair-WinGetPackageManager cmdlet usually handles these automatically Path Issues:

isn't recognized after installation, restart your PowerShell session or your computer to refresh environment variables PowerShell Gallery Execution Policy: If you can't run scripts, set the policy temporarily: powershell Set-ExecutionPolicy RemoteSigned -Scope Use code with caution. Copied to clipboard Export a list of your current apps to a "winget import" file. Set up a scheduled task to keep all your software updated daily. Configure settings like progress bar styles or experimental features.

Use WinGet to install and manage applications | Microsoft Learn But a cleaner way is to use a


Method 2: Extract and install from .msixbundle (if Method 1 fails)

# Expand the bundle
Expand-Archive -Path "winget.msixbundle" -DestinationPath "expanded"

Install/update the package for the current user (or machine)

Add-AppxPackage -Path $tempFile -ForceApplicationShutdown

Method A: Install via App Installer (Recommended)

Winget is part of the App Installer package from the Microsoft Store. You can download and install it directly using PowerShell.

# Add the Microsoft Store source if missing (rarely needed)
Add-WindowsPackage -Online -PackagePath "Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" -ErrorAction SilentlyContinue

But a cleaner way is to use a script that fetches the latest bundle from Microsoft’s CDN:

# Run as Administrator
$githubUrl = "https://api.github.com/repos/microsoft/winget-cli/releases/latest"
$release = Invoke-RestMethod -Uri $githubUrl
$asset = $release.assets | Where-Object  $_.name -like "*.msixbundle" 
$downloadUrl = $asset.browser_download_url
$output = "$env:TEMP\winget.msixbundle"

Invoke-WebRequest -Uri $downloadUrl -OutFile $output Add-AppxPackage -Path $output

After running these commands, close and reopen PowerShell as Administrator, then test with winget --version.

Common Errors and Troubleshooting

| Error | Solution | |-------|----------| | Add-AppxPackage : Deployment failed | Another user has the package. Use -ForceUpdateFromAnyVersion | | Invoke-RestMethod : The response content cannot be parsed | Check your internet / proxy settings. Use [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 before the Invoke call | | winget is not recognized | Close and reopen PowerShell as Admin. Or add %USERPROFILE%\AppData\Local\Microsoft\WindowsApps to your PATH | | Access Denied | You are not running PowerShell as Administrator | | Package repository is corrupt | Run winget source reset --force |


Step 3: Update Winget to the Latest Version Using PowerShell

Updating Winget is often simpler than installing it from scratch because once Winget exists, you can use Winget to update itself – but there’s a catch. Winget cannot update itself while it is in use. Microsoft provides an official PowerShell script to handle this.