Skip to content

Commit b91c53f

Browse files
committed
Policies as a Constant
1 parent 0d2faa2 commit b91c53f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/Winget-AutoUpdate/WAU-Settings-GUI.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Add-Type -AssemblyName PresentationFramework
2727

2828
# Constants of most used paths and arguments
2929
$Script:WAU_REGISTRY_PATH = "HKLM:\SOFTWARE\Romanitho\Winget-AutoUpdate"
30+
$Script:WAU_POLICIES_PATH = "HKLM:\SOFTWARE\Policies\Romanitho\Winget-AutoUpdate"
3031
$Script:CONHOST_EXE = "${env:SystemRoot}\System32\conhost.exe"
3132
$Script:POWERSHELL_ARGS = "--headless powershell.exe -NoProfile -ExecutionPolicy Bypass -File"
3233
$Script:DESKTOP_RUN_WAU = "${env:Public}\Desktop\Run WAU.lnk"
@@ -445,7 +446,7 @@ function Update-WAUGUIFromConfig {
445446
# Get GPO policies from registry
446447
$updatedPolicies = $null
447448
try {
448-
$updatedPolicies = Get-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Romanitho\Winget-AutoUpdate" -ErrorAction SilentlyContinue
449+
$updatedPolicies = Get-ItemProperty -Path $Script:WAU_POLICIES_PATH -ErrorAction SilentlyContinue
449450
}
450451
catch {
451452
# GPO registry key doesn't exist or can't be read

0 commit comments

Comments
 (0)