diff --git a/NewProject2.ps1 b/NewProject2.ps1 index f46f818..7a3a9cc 100644 --- a/NewProject2.ps1 +++ b/NewProject2.ps1 @@ -70,14 +70,19 @@ if($PSBoundParameters.ContainsKey("ProjectName")){ $fsrr = "Read" $fsrr = "Write" $type = "Allow" - $fsarar = @($rid,$fsrr,$type) - $fsaraw = @($wid,$fsrw,$type) + $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 $FolderACL.SetAccessRule($fileSystemAccessRuleR) $FolderACL.SetAccessRule($fileSystemAccessRuleW) + $FolderACL.SetAccessRule($fileSystemAccessRuleWR) + + Set-Acl -Path $folder.FullName -AclObject $FolderACL return $ret }