Skip to content

Commit fb1f0c9

Browse files
authored
Merge pull request #5178 from mdanish-kh/repair-wingetpackagemanager
Update WinGet sandbox script to use Repair-WinGetPackageManager cmdlet
2 parents e67f1ea + 3f75061 commit fb1f0c9

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

hub/package-manager/winget/index.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,15 @@ To install the stable release of WinGet on Windows Sandbox, follow these steps f
3737

3838
```powershell
3939
$progressPreference = 'silentlyContinue'
40-
Write-Information "Downloading WinGet and its dependencies..."
41-
Invoke-WebRequest -Uri https://aka.ms/getwinget -OutFile Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle
42-
Invoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile Microsoft.VCLibs.x64.14.00.Desktop.appx
43-
Invoke-WebRequest -Uri https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.6/Microsoft.UI.Xaml.2.8.x64.appx -OutFile Microsoft.UI.Xaml.2.8.x64.appx
44-
Add-AppxPackage Microsoft.VCLibs.x64.14.00.Desktop.appx
45-
Add-AppxPackage Microsoft.UI.Xaml.2.8.x64.appx
46-
Add-AppxPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle
40+
Write-Host "Installing WinGet PowerShell module from PSGallery..."
41+
Install-PackageProvider -Name NuGet -Force | Out-Null
42+
Install-Module -Name Microsoft.WinGet.Client -Force -Repository PSGallery | Out-Null
43+
Write-Host "Using Repair-WinGetPackageManager cmdlet to bootstrap WinGet..."
44+
Repair-WinGetPackageManager
45+
Write-Host "Done."
4746
```
4847

49-
If you would like a preview or different version of the Package Manager, go to https://github.com/microsoft/winget-cli/releases. Copy the URL of the version you would prefer and update the above Uri.
48+
To install the PowerShell module in machine scope, you can use the `-Scope AllUsers` parameter with the `Install-Module` cmdlet. If you would like a preview version of WinGet, you can add `-IncludePrerelease` parameter with the Repair-WinGetPackageManager cmdlet. To see the available parameters for the Repair-WinGetPackageManager cmdlet, you can run `Get-Help Repair-WinGetPackageManager -Full`.
5049

5150
For more information on Windows Sandbox, including how to install a sandbox and what to expect from it's usage, see the [Windows Sandbox docs](/windows/security/threat-protection/windows-sandbox/windows-sandbox-overview).
5251

0 commit comments

Comments
 (0)