Skip to content

Instantly share code, notes, and snippets.

@hebertviana
Last active March 26, 2020 02:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hebertviana/a7569060a5e55b33e2fae89b8e12dd3a to your computer and use it in GitHub Desktop.
Save hebertviana/a7569060a5e55b33e2fae89b8e12dd3a to your computer and use it in GitHub Desktop.
set permission
$mypath = "diretorio"
$myacl = Get-Acl $mypath
$myaclentry = "Todos","FullControl","Allow"
$myaccessrule = New-Object System.Security.AccessControl.FileSystemAccessRule($myaclentry)
$myacl.SetAccessRule($myaccessrule)
Get-ChildItem -Path "$mypath" -Recurse -Force | Set-Acl -AclObject $myacl -Verbose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment