Fixed multiple Winget installed versions
parent
41b61bd4d4
commit
cefdac2daa
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<app>
|
||||
<name>Winget-AutoUpdate (WAU)</name>
|
||||
<version>1.7.0</version>
|
||||
<version>1.7.1</version>
|
||||
<author>Romanitho</author>
|
||||
<info>https://github.com/Romanitho/Winget-AutoUpdate</info>
|
||||
</app>
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue