From c4113ea29eb67403aa29bfb03cfc8a9c7cefcaba Mon Sep 17 00:00:00 2001 From: KnifMelti Date: Tue, 16 Aug 2022 21:40:34 +0200 Subject: [PATCH] Sort WingetPath as INT --- Winget-AutoUpdate/functions/Get-WingetCmd.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Winget-AutoUpdate/functions/Get-WingetCmd.ps1 b/Winget-AutoUpdate/functions/Get-WingetCmd.ps1 index f6180f7..3058961 100644 --- a/Winget-AutoUpdate/functions/Get-WingetCmd.ps1 +++ b/Winget-AutoUpdate/functions/Get-WingetCmd.ps1 @@ -3,7 +3,7 @@ Function Get-WingetCmd { #Get WinGet Path (if admin context) - $ResolveWingetPath = Resolve-Path "C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe" + $ResolveWingetPath = Resolve-Path "C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe" | Sort-Object -Property {$_.Path -as [int]} if ($ResolveWingetPath) { #If multiple version, pick last one $WingetPath = $ResolveWingetPath[-1].Path