diff --git a/Winget-AutoUpdate/config/about.xml b/Winget-AutoUpdate/config/about.xml index c5291b8..f10bfda 100644 --- a/Winget-AutoUpdate/config/about.xml +++ b/Winget-AutoUpdate/config/about.xml @@ -1,7 +1,7 @@ Winget-AutoUpdate (WAU) - 1.7.0 + 1.7.1 Romanitho https://github.com/Romanitho/Winget-AutoUpdate - + \ No newline at end of file diff --git a/Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 b/Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 index 2817235..fc8a47c 100644 --- a/Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 +++ b/Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 @@ -6,8 +6,13 @@ function Get-WingetOutdatedApps { [string]$AvailableVersion } - #Get WinGet Path - $WingetPath = (Resolve-Path "C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe").Path + #Get WinGet Path (if admin context) + $ResolveWingetPath = Resolve-Path "C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe" + if ($ResolveWingetPath){ + #If multiple version, pick last one + $WingetPath = $ResolveWingetPath[-1].Path + } + #Get Winget Location in User context if ($WingetCmd){ $Script:Winget = (Get-Command winget.exe -ErrorAction SilentlyContinue).Source