1 parent 0ee064c commit a6e9e09Copy full SHA for a6e9e09
1 file changed
functions/private/Install-WinUtilWinget.ps1
@@ -52,7 +52,10 @@ function Install-WinUtilWinget {
52
53
# Check if Windows version supports Repair-WinGetPackageManager (24H2 and above)
54
if ([System.Environment]::OSVersion.Version.Build -ge 26100) {
55
- Install-Module -Name Microsoft.WinGet.Client -Force -ErrorAction Continue
+ Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
56
+ Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
57
+ Install-Module "Microsoft.WinGet.Client" -Force
58
+ Import-Module Microsoft.WinGet.Client
59
Repair-WinGetPackageManager -Force -Latest -Verbose
60
# Verify if repair was successful
61
$wingetCmd = Get-Command winget -ErrorAction Stop
0 commit comments