Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用powershell映射驱动器_Powershell - Fatal编程技术网

如何使用powershell映射驱动器

如何使用powershell映射驱动器,powershell,Powershell,如何在PowerShell上使用用户名和密码映射网络驱动器 我正在尝试执行与命令提示符(cmd.exe)命令等效的操作: 我在这个网站上找到了下面的解决方案,但下面有一个错误。以下是命令和错误: $net = new-object -ComObject WScript.Network$net.MapNetworkDrive ("r:", "\\10.10.10.1\$f", $false, "prod\joe", "myStrongPasswordHere") 新对象:找不到接受参数“Syst

如何在PowerShell上使用用户名和密码映射网络驱动器

我正在尝试执行与命令提示符(cmd.exe)命令等效的操作:

我在这个网站上找到了下面的解决方案,但下面有一个错误。以下是命令和错误:

$net = new-object -ComObject WScript.Network$net.MapNetworkDrive
("r:", "\\10.10.10.1\$f", $false, "prod\joe", "myStrongPasswordHere")
新对象:找不到接受参数“System.Object”的位置参数
[]'.
第1行字符:18

+$net=新对象老实说,我只会使用
net使用
例如:

PS> net use G: \\10.10.10.1\f$ /USER:prod\joe myStrongPasswordHere

你的运气可能会更好
PS> net use G: \\10.10.10.1\f$ /USER:prod\joe myStrongPasswordHere