From 5b5d72f335b230c2271c109fa46f16d9aa701c6b Mon Sep 17 00:00:00 2001 From: Karl-Wilfried Zimmer Date: Sun, 14 Jul 2024 21:27:44 +0200 Subject: [PATCH] made acl setting work --- NewProject2.ps1 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 }