Script
ローカルユーザーlocalUserにE:/ShareフォルダのNTFSアクセス許可(編集)を与える.
$folder = “E:¥Share”
$hostname = [System.Environment]::MachineName
$user= "user"
$aclParams = @("$hostname\$user",
[System.Security.AccessControl.FileSystemRights]::Modify,
[System.Security.AccessControl.InheritanceFlags]::None,
[System.Security.AccessControl.PropagationFlags]::None,
[System.Security.AccessControl.AccessControlType]::Allow)
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule $aclParams
$acl = Get-Acl $folder
$acl.AddAccessRule($rule)
Set-Acl $folder -AclObject $acl
補足
NTFSって?
Windows NT系のファイルシステムらしい.
参考
http://yomon.hatenablog.com/entry/2015/04/10/170518
https://www.blackcat.xyz/article.php/ProgFAQ-PS_Set-Acl
http://tech.lecume.net/power-shell/configure-filesystem-acl