Skip to content

Commit a6e9e09

Browse files
[Applications] Possible fix for cmdlet (ChrisTitusTech#3563)
1 parent 0ee064c commit a6e9e09

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

functions/private/Install-WinUtilWinget.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ function Install-WinUtilWinget {
5252

5353
# Check if Windows version supports Repair-WinGetPackageManager (24H2 and above)
5454
if ([System.Environment]::OSVersion.Version.Build -ge 26100) {
55-
Install-Module -Name Microsoft.WinGet.Client -Force -ErrorAction Continue
55+
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
5659
Repair-WinGetPackageManager -Force -Latest -Verbose
5760
# Verify if repair was successful
5861
$wingetCmd = Get-Command winget -ErrorAction Stop

0 commit comments

Comments
 (0)