NotificationLevel done

pull/257/head
KnifMelti 2022-12-28 13:52:03 +01:00
parent 4e660e3546
commit 96b1900b31
3 changed files with 39 additions and 0 deletions

View File

@ -90,5 +90,28 @@
<text id="ModsPath" valueName="WAU_ModsPath" required="true" /> <text id="ModsPath" valueName="WAU_ModsPath" required="true" />
</elements> </elements>
</policy> </policy>
<policy name="NotificationLevel" class="Machine" displayName="$(string.NotificationLevel)" explainText="$(string.NotificationLevel_Explain)" key="Software\Policies\Romanitho\Winget-AutoUpdate" presentation="$(presentation.NotificationLevel)">
<parentCategory ref="WAU"/>
<supportedOn ref="WAU:SUPPORTED_WAU_1_15_3"/>
<elements>
<enum id="NotificationLevel" valueName="WAU_NotificationLevel">
<item displayName="$(string.NotificationLevel_Full)">
<value>
<string>Full</string>
</value>
</item>
<item displayName="$(string.NotificationLevel_SuccessOnly)">
<value>
<string>SuccessOnly</string>
</value>
</item>
<item displayName="$(string.NotificationLevel_None)">
<value>
<string>None</string>
</value>
</item>
</enum>
</elements>
</policy>
</policies> </policies>
</policyDefinitions> </policyDefinitions>

View File

@ -22,6 +22,12 @@
<string id="ListPath_Explain">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.</string> <string id="ListPath_Explain">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.</string>
<string id="ModsPath">Get Mods from external Path (URL/UNC/Local)</string> <string id="ModsPath">Get Mods from external Path (URL/UNC/Local)</string>
<string id="ModsPath_Explain">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.</string> <string id="ModsPath_Explain">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.</string>
<string id="NotificationLevel">Notification Level</string>
<string id="NotificationLevel_Explain">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.</string>
<string id="NotificationLevel_Full">1. Full (Default, displays all notifications)</string>
<string id="NotificationLevel_SuccessOnly">2. SuccessOnly (Only displays notifications for success)</string>
<string id="NotificationLevel_None">3. None (Does not display any notification)</string>
</stringTable> </stringTable>
<presentationTable> <presentationTable>
<presentation id="ListPath"> <presentation id="ListPath">
@ -34,6 +40,9 @@
<label>(URL/UNC/Local) Path:</label> <label>(URL/UNC/Local) Path:</label>
</textBox> </textBox>
</presentation> </presentation>
<presentation id="NotificationLevel">
<dropdownList refId="NotificationLevel"/>
</presentation>
</presentationTable> </presentationTable>
</resources> </resources>
</policyDefinitionResources> </policyDefinitionResources>

View File

@ -79,6 +79,13 @@ if ($IsSystem) {
elseif ($null -eq $WAUPolicies.WAU_ModsPath) { elseif ($null -eq $WAUPolicies.WAU_ModsPath) {
Remove-ItemProperty $regPath"\" -Name WAU_ModsPath -Force -ErrorAction SilentlyContinue | Out-Null 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
}
} }
} }
} }