I have a function which grant the user permission to a folder.
$acl = Get-Acl $Path
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule('Users', 'FullControl', "ContainerInherit,ObjectInherit","None", 'Allow')
$acl.AddAccessRule($rule)
Set-Acl $Path $acl
It works fine with path like
$Path = 'C:\Test\'
$Path = '\\$env:computername\e$'
But it doesn't work if
$Path = 'E:\'
'E:\' only works with
$acl = (Get-Item $FolderName).GetAccessControl('Access')
I don't quite get it since '\\computername\e$' and 'E:\' point to the same place. Does anyone have idea of what is the difference.