Install Winget Using Powershell Updated -

Installing and Updating Winget Using PowerShell: A Comprehensive Guide

Method 2: The Direct Download (If Method 1 fails)

If the command above fails (usually due to network restrictions or Store cache issues), you can download the latest .msixbundle directly from Microsoft's GitHub repository.

  1. Open PowerShell as Administrator.
  2. Run the following script block (copy the whole block):
# 1. Define the URL for the latest release (v1.7.10861 as of late 2024, subject to change)
# Ideally, check https://github.com/microsoft/winget-cli/releases for the absolute latest .msixbundle link
$URL = "https://github.com/microsoft/winget-cli/releases/download/v1.7.10861/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"

Step 5: What If Winget Is Installed But Not Working?

Some users report that winget commands hang or fail even after installation. This usually relates to Windows’ execution policy or corrupted sources.

Reset the Winget sources:

winget source reset --force

Check your PowerShell execution policy:

Get-ExecutionPolicy

If it’s Restricted, run:

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

Then retry Winget commands.

Repair the App Installer package using PowerShell: install winget using powershell updated

Get-AppxPackage Microsoft.DesktopAppInstaller | Repair-AppxPackage

5. Clean up

Remove-Item -Path $outputPath -Force

Write-Host "Winget installed/updated successfully!" -ForegroundColor Green

Final Verification

After installing or updating, run these sanity tests:

winget --version
winget list --upgrade-available
winget search Firefox

If all commands succeed, your Winget installation is healthy and up‑to‑date.


Common errors & fixes

| Error | Fix | |-------|-----| | Add-AppxPackage fails | Enable Developer Mode: Settings > Update & Security > For developers | | 0x80073D05 | Install all missing dependencies (VCLibs, UI.Xaml) | | winget not recognized | Log off / restart, or add %LOCALAPPDATA%\Microsoft\WindowsApps to PATH | | Windows LTSC | Install App Installer from Store using wsreset -i or manually via .appx | Open PowerShell as Administrator


Verify installation

winget --version
winget search git

Recommended: Use the Offline GitHub Installer via PowerShell

Run the following script to download and apply the latest Winget update:

# Fetch latest release info from GitHub
$latestRelease = Invoke-RestMethod -Uri "https://api.github.com/repos/microsoft/winget-cli/releases/latest"
$bundleUrl = ($latestRelease.assets | Where-Object  $_.name -like "*.msixbundle" ).browser_download_url