diff --git a/NewProject2.ps1 b/NewProject2.ps1 index 7a3a9cc..8cdbcf4 100644 --- a/NewProject2.ps1 +++ b/NewProject2.ps1 @@ -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)