我正在尝试使用PowerShell在远程服务器上运行.cmd文件。
在我的.ps1脚本中,我尝试了这样做:
C:\MyDirectory\MyCommand.cmd
它会导致以下错误:
C:\MyDirectory\MyCommand.cmd is not recognized as the name of a cmdlet,
function, script file, or operable program.
还有这个
Invoke-Command C:\MyDirectory\MyCommand.cmd
导致此错误:
Invoke-Command : Parameter set cannot be resolved using the specified named
parameters.
我不需要向PowerShell脚本传递任何参数。我要寻找的正确语法是什么?
https://stackoverflow.com/questions/20423424
复制相似问题