From a6e9e096ef09f2ce3cda38bbda21249820606ff0 Mon Sep 17 00:00:00 2001 From: CodingWonders <101426328+CodingWonders@users.noreply.github.com> Date: Thu, 28 Aug 2025 20:15:42 +0200 Subject: [PATCH] [Applications] Possible fix for cmdlet (#3563) --- functions/private/Install-WinUtilWinget.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/functions/private/Install-WinUtilWinget.ps1 b/functions/private/Install-WinUtilWinget.ps1 index f072c34a..7e7b8680 100644 --- a/functions/private/Install-WinUtilWinget.ps1 +++ b/functions/private/Install-WinUtilWinget.ps1 @@ -52,7 +52,10 @@ function Install-WinUtilWinget { # Check if Windows version supports Repair-WinGetPackageManager (24H2 and above) if ([System.Environment]::OSVersion.Version.Build -ge 26100) { - Install-Module -Name Microsoft.WinGet.Client -Force -ErrorAction Continue + Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force + Set-PSRepository -Name PSGallery -InstallationPolicy Trusted + Install-Module "Microsoft.WinGet.Client" -Force + Import-Module Microsoft.WinGet.Client Repair-WinGetPackageManager -Force -Latest -Verbose # Verify if repair was successful $wingetCmd = Get-Command winget -ErrorAction Stop