fixed acl issue

This commit is contained in:
Karl-Wilfried Zimmer 2024-07-14 23:34:15 +02:00
parent ddaa5a3305
commit eeb8abbd45

View File

@ -67,16 +67,13 @@ if($PSBoundParameters.ContainsKey("ProjectName")){
$rid = $ReadTarget.Name
$wid = $WriteTarget.Name
$fsrr = "Read"
$fsrr = "Write"
$fsrr = "ReadAndExecute"
$fsrw = "Write"
$type = "Allow"
$fsarar = @($rid,$fsrr,,,$type)
$fsaraw = @($wid,$fsrw,,,$type)
$fsarawr = @($wid,$fsrr,,,$type)
$fileSystemAccessRuleR = New-Object -TypeName System.Security.AccessControl.FileSystemAccessRule -ArgumentList $fsarar
$fileSystemAccessRuleW = New-Object -TypeName System.Security.AccessControl.FileSystemAccessRule -ArgumentList $fsaraw
$fileSystemAccessRuleWR = New-Object -TypeName System.Security.AccessControl.FileSystemAccessRule -ArgumentList $fsarawr
$fileSystemAccessRuleR = New-Object System.Security.AccessControl.FileSystemAccessRule($rid,$fsrr,"ContainerInherit, ObjectInherit",,$type)
$fileSystemAccessRuleW = New-Object System.Security.AccessControl.FileSystemAccessRule($Wid,$fsrw,"ContainerInherit, ObjectInherit",,$type)
$fileSystemAccessRuleWR = New-Object System.Security.AccessControl.FileSystemAccessRule($rid,$fsrr,"ContainerInherit, ObjectInherit",,$type)
$FolderACL.SetAccessRule($fileSystemAccessRuleR)
$FolderACL.SetAccessRule($fileSystemAccessRuleW)