试图通过windows powershell允许其他用户访问图片文件夹

时间:2016-10-07 18:56:46

标签: powershell

$sharepath = "C:\foldername"
$Acl = Get-ACL $SharePath
$AccessRule= New-Object System.Security.AccessControl.FileSystemAccessRule("everyone","full","ContainerInherit,Objectinherit","none","Allow")
$Acl.AddAccessRule($AccessRule)
Set-Acl $SharePath $Acl

这是我在搜索答案时找到的代码,但它对我不起作用。

我收到的错误消息:

At line:1 char:28
+$sharepath = "C:\Pictures" $Acl = Get-Acl $Sharepath $AccessRule= New ...
+                           ~~~~~
Unexpected token '$Ac1' in expression or statement.
    + CategoryInfo          :ParserError: (:) [], ParentContainsErrorRecordException
+FullyQualifiedErrorId : UnexpectedToken

0 个答案:

没有答案