#Winget installation and updating
8 messages · Page 1 of 1 (latest)
I found this on Reddit I'll have to see if it works, seemed like the poster was having trouble with it
try {
winget --version
} catch {
Write-Host "Winget not present / outdated"
# Get the download URL of the latest winget installer from GitHub:
$API_URL = "https://api.github.com/repos/microsoft/winget-cli/releases/latest"
$DOWNLOAD_URL = $(Invoke-RestMethod $API_URL).assets.browser_download_url |
Where-Object {$_.EndsWith(".msixbundle")}
# Download the installer:
Invoke-WebRequest -URI $DOWNLOAD_URL -OutFile winget.msixbundle -UseBasicParsing
# Install winget:
Add-AppxPackage winget.msixbundle
# Remove the installer:
Remove-Item winget.msixbundle
}
current link is https://github.com/microsoft/winget-cli/releases/download/v1.9.25200/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle but i don't know how i would keep this consistently updated
since the filename changes, you can get the current one from https://api.github.com/repos/microsoft/winget-cli/releases/latest
oh nvm that script already does it
lol
i missed that too 😭
i guess i'll use that script then