Powershell Invoke-command使用文件共享

时间:2015-09-15 14:54:14

标签: powershell

我有一个power shell脚本,当它位于本地计算机上时运行正常。如果我运行test.ps1文件,它会执行。 Test.ps1有一个代码来使用当前工作目录并从当前工作目录中读取xml文件

当我尝试使用invoke-command并从文件共享运行此脚本时,我收到错误消息无法找到路径左右.. 这是我的语法:

Invoke-command -computername "test1" -filepath "\\xyz\test\test.ps1"

上面的语法不起作用......

然后我尝试了几个像

这样的事情
invoke-command -computername "test1" -scriptblock{\\xyz\test\test.ps1}

invoke-command -computername "test1" -scriptblock{(param $x) \\xyz\test\test.ps1} -Argumentlist $scriptroot

他们都没有工作..

0 个答案:

没有答案
相关问题