Last active
March 17, 2026 01:59
-
-
Save crutkas/6c2096eae387e544bd05cde246f23901 to your computer and use it in GitHub Desktop.
InstallWinGet PowerShell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function InstallWinGet() | |
| { | |
| $hasPackageManager = Get-AppPackage -name "Microsoft.DesktopAppInstaller" | |
| if(!$hasPackageManager) | |
| { | |
| $releases_url = "https://api.github.com/repos/microsoft/winget-cli/releases/latest" | |
| [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | |
| $releases = Invoke-RestMethod -uri "$($releases_url)" | |
| $latestRelease = $releases.assets | Where { $_.browser_download_url.EndsWith("msixbundle") } | Select -First 1 | |
| Add-AppxPackage -Path $latestRelease.browser_download_url | |
| } | |
| } | |
| <# | |
| Add-AppxPackage -Path "https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx" | |
| $releases_url = "https://api.github.com/repos/microsoft/winget-cli/releases/latest" | |
| [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | |
| $releases = Invoke-RestMethod -uri "$($releases_url)" | |
| $latestRelease = $releases.assets | Where { $_.browser_download_url.EndsWith("appxbundle") } | Select -First 1 | |
| Add-AppxPackage -Path $latestRelease.browser_download_url | |
| #> |
@hoang-himself thank you so much!!! You've saved my life, it works!
Author
@Grelo4ka https://github.com/crutkas/setup may be more helpful from some of the scripts in it
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Why go such length?