From 7a560718c5c56e191e328513022077642a6eb284 Mon Sep 17 00:00:00 2001 From: KnifMelti Date: Wed, 26 Oct 2022 22:10:44 +0200 Subject: [PATCH] Combined $IsSystem --- Winget-AutoUpdate/Winget-Upgrade.ps1 | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Winget-AutoUpdate/Winget-Upgrade.ps1 b/Winget-AutoUpdate/Winget-Upgrade.ps1 index 9e0006c..0c823d6 100644 --- a/Winget-AutoUpdate/Winget-Upgrade.ps1 +++ b/Winget-AutoUpdate/Winget-Upgrade.ps1 @@ -49,10 +49,10 @@ if (Test-Network) { #Get Current Version $WAUCurrentVersion = $WAUConfig.DisplayVersion Write-Log "WAU current version: $WAUCurrentVersion" - #Check if WAU update feature is enabled or not - $WAUDisableAutoUpdate = $WAUConfig.WAU_DisableAutoUpdate - #If yes then check WAU update if System if ($IsSystem) { + #Check if WAU update feature is enabled or not + $WAUDisableAutoUpdate = $WAUConfig.WAU_DisableAutoUpdate + #If yes then check WAU update if System if ($WAUDisableAutoUpdate -eq 1) { Write-Log "WAU AutoUpdate is Disabled." "Grey" } @@ -70,10 +70,8 @@ if (Test-Network) { Write-Log "WAU is up to date." "Green" } } - } - if ($IsSystem) { - #Get External ListPath + #Get External ListPath if System if ($WAUConfig.WAU_ListPath) { Write-Log "WAU uses External Lists from: $($WAUConfig.WAU_ListPath)" $NewList = Test-ListPath $WAUConfig.WAU_ListPath $WAUConfig.WAU_UseWhiteList $WAUConfig.InstallLocation @@ -90,6 +88,7 @@ if (Test-Network) { } } } + } #Get White or Black list