回答PS本地会话中无法列出远程共享文件夹内存,但是在本地会话中却可以列出


[10.78.47.176]: PS C:\> New-PSDrive -Name N -PSProvider FileSystem -Root \\waawebsite5\website

Name           Used (GB)     Free (GB) Provider      Root                                               CurrentLocation
----           ---------     --------- --------      ----                                               ---------------
N                                      FileSystem    \\waawebsite5\website


[10.78.47.176]: PS C:\> ls n:
ls : 拒绝访问。
    + CategoryInfo          : PermissionDenied: (\\waawebsite5\website\:String) [Get-ChildItem], UnauthorizedAccessExc
   eption
    + FullyQualifiedErrorId : ItemExistsUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemCommand

ls : 找不到路径“\\waawebsite5\website\”,因为该路径不存在。
    + CategoryInfo          : ObjectNotFound: (\\waawebsite5\website\:String) [Get-ChildItem], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

[10.78.47.176]: PS C:\> Get-PSDrive

Name           Used (GB)     Free (GB) Provider      Root                                               CurrentLocation
----           ---------     --------- --------      ----                                               ---------------
A                                      FileSystem    A:\
Alias                                  Alias
C                   9.92         49.73 FileSystem    C:\
Cert                                   Certificate   \
D                   4.32               FileSystem    D:\
Env                                    Environment
Function                               Function
HKCU                                   Registry      HKEY_CURRENT_USER
HKLM                                   Registry      HKEY_LOCAL_MACHINE
IIS                                    WebAdminis... \\COREIISTEST
N                                      FileSystem    \\waawebsite5\website
Variable                               Variable
WSMan                                  WSMan

我上午试了这个