It is very simple...

$path = 'C:\Temp'

New-Item -Path $path -ItemType directory
$acl = Get-Acl -Path $path
$permission = 'Everyone', 'FullControl', 'ContainerInherit, ObjectInherit', 'None', 'Allow'
$rule = New-Object -TypeName System.Security.AccessControl.FileSystemAccessRule -ArgumentList $permission
$acl.SetAccessRule($rule)
$acl | Set-Acl -Path $path
« Previous Next »