made acl setting work
This commit is contained in:
parent
f926dfb60d
commit
5b5d72f335
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user