From cf6ee6b96f76e0f4d6a27d1647282e411aa81071 Mon Sep 17 00:00:00 2001 From: Romain <96626929+Romanitho@users.noreply.github.com> Date: Fri, 8 Apr 2022 00:15:11 +0200 Subject: [PATCH] Update Get-WingetOutdatedApps.ps1 --- Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 b/Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 index fc8a47c..fb1298c 100644 --- a/Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 +++ b/Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 @@ -14,8 +14,9 @@ function Get-WingetOutdatedApps { } #Get Winget Location in User context + $WingetCmd = Get-Command winget.exe -ErrorAction SilentlyContinue if ($WingetCmd){ - $Script:Winget = (Get-Command winget.exe -ErrorAction SilentlyContinue).Source + $Script:Winget = $WingetCmd.Source } #Get Winget Location in System context (WinGet < 1.17) elseif (Test-Path "$WingetPath\AppInstallerCLI.exe"){