Set-AppRegPermissions
Description:
Modify Registry Permissions
Language:
Powershell
Usage Type:
Packaging Function
Script Source:
function Set-AppRegPermissions ($Setting, $RegPath) { ######################################## # Modify Registry Permissions # Function Date: 19.7.26.1 # Function by Chad Loevinger ######################################## if (($Setting) -and ($RegPath)) { try { Log-Action -Message "Setting ""$($Setting)"" permission on ""$($RegPath)""..." $acl = Get-Acl "$($RegPath)" $rule = New-Object System.Security.AccessControl.RegistryAccessRule ("Everyone","$($Setting)",@("ObjectInherit","ContainerInherit"),"None","Allow") $acl.SetAccessRule($rule) $acl | Set-Acl -Path "$($RegPath)" Log-Action -Message " - Success!" return $true } catch { Log-Action -Message " - Error!" return $false } } else { Log-Action -Message " - Error! (Incomplete Parameters Passed)" return $false } }
Note: that all applications posted here are posted for use, both commercial and non-commercial, free of charge, and as such are provided as-is, without warranty of any kind whatsoever. visuaFUSION, FMSCUG or any other program listed here's author are not responsible for any damages or shortcomings that result from usage of any of these applications.