UNC路径的测试路径为假

时间:2019-01-29 09:50:48

标签: powershell

我正在尝试使Get-Acl工作,但是当我使用UNC路径时,它似乎返回false。我运行了Test-Path,它也返回false。

我在本地文件夹上测试了Test-Path,并且仍然相同。 UNC路径返回false,但当普通路径返回true时。我在做什么错了?

PS C:\windows\system32> Get-Acl \\computername\Asset
Get-Acl : Cannot find path '\\phmangang01\Asset' because it does not exist.
At line:1 char:1
+ Get-Acl \\phmangang01\Asset
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (:) [Get-Acl], ItemNotFoundException
    + FullyQualifiedErrorId : GetAcl_PathNotFound_Exception,Microsoft.PowerShell.Commands.GetAclCommand

PS C:\windows\system32> Get-Acl C:\Asset

    Directory: C:\

Path  Owner                  Access
----  -----                  ------
Asset BUILTIN\Administrators BUILTIN\Administrators Allow  FullControl...

PS C:\windows\system32> Test-Path \\computer name\Asset
False
PS C:\windows\system32> Test-Path C:\Asset
True

0 个答案:

没有答案
相关问题