From 96b1900b31256c65643f78f23514994dafa0e07f Mon Sep 17 00:00:00 2001 From: KnifMelti Date: Wed, 28 Dec 2022 13:52:03 +0100 Subject: [PATCH] NotificationLevel done --- Policies/WAU.admx | 23 +++++++++++++++++++++++ Policies/en-US/WAU.adml | 9 +++++++++ Winget-AutoUpdate/Winget-Upgrade.ps1 | 7 +++++++ 3 files changed, 39 insertions(+) diff --git a/Policies/WAU.admx b/Policies/WAU.admx index 25002e7..bcf4d13 100644 --- a/Policies/WAU.admx +++ b/Policies/WAU.admx @@ -90,5 +90,28 @@ + + + + + + + + Full + + + + + SuccessOnly + + + + + None + + + + + \ No newline at end of file diff --git a/Policies/en-US/WAU.adml b/Policies/en-US/WAU.adml index c9c9dab..998d48f 100644 --- a/Policies/en-US/WAU.adml +++ b/Policies/en-US/WAU.adml @@ -22,6 +22,12 @@ If this policy is enabled, you can set a (URL/UNC/Local) Path to external lists other than the default. If this policy is disabled or not configured, the default ListPath is used. 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. + 1. Full (Default, displays all notifications) + 2. SuccessOnly (Only displays notifications for success) + 3. None (Does not display any notification) @@ -34,6 +40,9 @@ + + + diff --git a/Winget-AutoUpdate/Winget-Upgrade.ps1 b/Winget-AutoUpdate/Winget-Upgrade.ps1 index 5e5ad0b..92dd12d 100644 --- a/Winget-AutoUpdate/Winget-Upgrade.ps1 +++ b/Winget-AutoUpdate/Winget-Upgrade.ps1 @@ -79,6 +79,13 @@ if ($IsSystem) { elseif ($null -eq $WAUPolicies.WAU_ModsPath) { Remove-ItemProperty $regPath"\" -Name WAU_ModsPath -Force -ErrorAction SilentlyContinue | Out-Null } + + if ($null -ne $WAUPolicies.WAU_NotificationLevel -and ($WAUPolicies.WAU_NotificationLevel -ne $WAUConfig.WAU_NotificationLevel)) { + New-ItemProperty $regPath -Name WAU_NotificationLevel -Value $WAUPolicies.WAU_NotificationLevel -Force | Out-Null + } + elseif ($null -eq $WAUPolicies.WAU_NotificationLevel) { + New-ItemProperty $regPath -Name WAU_NotificationLevel -Value "Full" -Force | Out-Null + } } } }