From ba6ed977b8852027806ff45c2869763a4d0565dc Mon Sep 17 00:00:00 2001 From: KnifMelti Date: Wed, 28 Dec 2022 16:07:18 +0100 Subject: [PATCH] Text and List/Mods Path error handling --- Policies/en-US/WAU.adml | 8 ++++++-- Winget-AutoUpdate/Winget-Upgrade.ps1 | 14 +++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Policies/en-US/WAU.adml b/Policies/en-US/WAU.adml index 998d48f..99d2624 100644 --- a/Policies/en-US/WAU.adml +++ b/Policies/en-US/WAU.adml @@ -23,8 +23,12 @@ Get Mods from external Path (URL/UNC/Local) If this policy is enabled, you can set a (URL/UNC/Local) Path to external mods other than the default. If this policy is disabled or not configured, the default ModsPath is used. Notification Level - If this policy is enabled, you can configure Notification Level: Full (Default, displays all notifications), SuccessOnly (Only displays notifications for success) or None (Does not display any notification). -If this policy is not configured or disabled, the default displays all notifications. + If this policy is enabled, you can configure the Notification Level: +1. Full (Default, displays all notifications) +2. SuccessOnly (Only displays notifications for success) +3. None (Does not display any notification) + +If this policy is not configured or disabled, the Default displays all notifications (1. Full). 1. Full (Default, displays all notifications) 2. SuccessOnly (Only displays notifications for success) 3. None (Does not display any notification) diff --git a/Winget-AutoUpdate/Winget-Upgrade.ps1 b/Winget-AutoUpdate/Winget-Upgrade.ps1 index ee23865..c01d3b8 100644 --- a/Winget-AutoUpdate/Winget-Upgrade.ps1 +++ b/Winget-AutoUpdate/Winget-Upgrade.ps1 @@ -144,10 +144,10 @@ if (Test-Network) { #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 + Write-Log "WAU uses External Lists from: $($WAUConfig.WAU_ListPath.TrimEnd(" ", "\", "/"))" + $NewList = Test-ListPath $WAUConfig.WAU_ListPath.TrimEnd(" ", "\", "/") $WAUConfig.WAU_UseWhiteList $WAUConfig.InstallLocation.TrimEnd(" ", "\") if ($NewList) { - Write-Log "Newer List downloaded/copied to local path: $($WAUConfig.InstallLocation)" "Yellow" + Write-Log "Newer List downloaded/copied to local path: $($WAUConfig.InstallLocation.TrimEnd(" ", "\"))" "Yellow" } else { if ((Test-Path "$WorkingDir\included_apps.txt") -or (Test-Path "$WorkingDir\excluded_apps.txt")) { @@ -163,10 +163,10 @@ if (Test-Network) { #Get External ModsPath if System if ($WAUConfig.WAU_ModsPath) { - Write-Log "WAU uses External Mods from: $($WAUConfig.WAU_ModsPath)" - $NewMods, $DeletedMods = Test-ModsPath $WAUConfig.WAU_ModsPath $WAUConfig.InstallLocation + Write-Log "WAU uses External Mods from: $($WAUConfig.WAU_ModsPath.TrimEnd(" ", "\", "/"))" + $NewMods, $DeletedMods = Test-ModsPath $WAUConfig.WAU_ModsPath.TrimEnd(" ", "\", "/") $WAUConfig.InstallLocation.TrimEnd(" ", "\") if ($NewMods -gt 0) { - Write-Log "$NewMods newer Mods downloaded/copied to local path: $($WAUConfig.InstallLocation)\mods" "Yellow" + Write-Log "$NewMods newer Mods downloaded/copied to local path: $($WAUConfig.InstallLocation.TrimEnd(" ", "\"))\mods" "Yellow" } else { if (Test-Path "$WorkingDir\mods\*.ps1") { @@ -177,7 +177,7 @@ if (Test-Network) { } } if ($DeletedMods -gt 0) { - Write-Log "$DeletedMods Mods deleted (not externally managed) from local path: $($WAUConfig.InstallLocation)\mods" "Red" + Write-Log "$DeletedMods Mods deleted (not externally managed) from local path: $($WAUConfig.InstallLocation.TrimEnd(" ", "\"))\mods" "Red" } } }