Allow anyone to edit config
This commit is contained in:
parent
c1979a1197
commit
2f959ff6ac
1 changed files with 9 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue