Sort WingetPath as INT

pull/149/head
KnifMelti 2022-08-16 21:40:34 +02:00
parent c1dcdc603a
commit c4113ea29e
1 changed files with 1 additions and 1 deletions

View File

@ -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