小编RSc*_*eib的帖子

无法将“-persist”添加到 New-PSDrive - 出现错误“网络资源类型不正确”

正如标题所说,如果我尝试添加-persist到 cmdlt,它会返回一个错误:

New-PSDrive : The network resource type is not correct At line:1 char:1 + New-PSDrive -Name P -Root <redacted> ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (P:PSDriveInfo) [New-PSDrive], Win32Exception + FullyQualifiedErrorId : CouldNotMapNetworkDrive,Microsoft.PowerShell.Commands.NewPSDriveCommand

作为参考,这是 PowerShell 中的管理员会话,但如果我在常规用户会话中执行此操作,我会得到完全相同的响应:

PS> $PSVersionTable.psversion

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      16299  666
Run Code Online (Sandbox Code Playgroud)

从一开始:我验证我要使用的驱动器号是否可用(在本例中为 P)

PS> get-psdrive

Name           Used (GB)     Free (GB) Provider      Root                                               CurrentLocation
----           ---------     --------- --------      ----                                               ---------------
Alias                                  Alias
C                  36.80         22.11 FileSystem    C:\                                               windows\system32
Cert …
Run Code Online (Sandbox Code Playgroud)

powershell windows-scripting drive-mapping powershell-v5.1 new-psdrive

8
推荐指数
1
解决办法
1万
查看次数