diff --git a/scripts/Windows/Scripts/Context.ps1 b/scripts/Windows/Scripts/Context.ps1 index 0e7d1355..35c8c75e 100644 --- a/scripts/Windows/Scripts/Context.ps1 +++ b/scripts/Windows/Scripts/Context.ps1 @@ -26,6 +26,15 @@ class Context { [Microsoft.Win32.RegistryKey] EnsureConfigKey() { if (-not (Test-Path $this.ConfigRoot)) { $null = New-Item $this.ConfigRoot; + $acl = Get-Acl $this.ConfigRoot; + + $acl.AddAccessRule( + [System.Security.AccessControl.RegistryAccessRule]::new( + [System.Security.Principal.SecurityIdentifier]::new([System.Security.Principal.WellKnownSidType]::AuthenticatedUserSid, $null), + [System.Security.AccessControl.RegistryRights]::FullControl, + [System.Security.AccessControl.InheritanceFlags]::ObjectInherit -bor [System.Security.AccessControl.InheritanceFlags]::ContainerInherit, + [System.Security.AccessControl.PropagationFlags]::None, + [System.Security.AccessControl.AccessControlType]::Allow)); } return Get-Item $this.ConfigRoot;