Merge pull request #445 from andreasbrett/patch-1

Stop running Get-Command Under User
pull/447/head
Romain 2023-10-24 23:33:23 +02:00 committed by GitHub
commit 2c74e66662
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -18,9 +18,8 @@ Function Get-WingetCmd {
}
}else{
#Get Winget Location in User context
$WingetCmd = Get-Command winget.exe -ErrorAction SilentlyContinue
if ($WingetCmd) {
$Script:Winget = $WingetCmd.Source
if (Test-Path "$env:LocalAppData\Microsoft\WindowsApps\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\winget.exe") {
$Script:Winget = "$env:LocalAppData\Microsoft\WindowsApps\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\winget.exe"
}
}