使用powershell invoke-command执行robocopy时的对象引用错误

时间:2015-10-16 09:09:39

标签: powershell robocopy

我得到"对象引用未设置为对象的实例"当我尝试在远程计算机上使用powershell invoke-command执行robocopy命令时。

这是我尝试执行的简单脚本

Invoke-Command -ComputerName myremotemachine -Credential xxx\abcd -ScriptBlock  {
    $deploymentDrive = "D"
    Robocopy "${deploymentDrive}:\myservice\" "${deploymentDrive}:\backup\myservicebackup\" /MIR /XA:SH /R:5 /W:15 /MT:32 /LOG:"${deploymentDrive}:\backup\copyofmyservicebackup.log"
}

非常感谢任何帮助。

0 个答案:

没有答案