Dec*_*lty 25 windows powershell cmd
我试图使用PowerShell在远程服务器上运行.cmd文件.
在我的.ps1脚本中我试过这个:
C:\MyDirectory\MyCommand.cmd
Run Code Online (Sandbox Code Playgroud)
它导致此错误:
C:\MyDirectory\MyCommand.cmd is not recognized as the name of a cmdlet,
function, script file, or operable program.
Run Code Online (Sandbox Code Playgroud)
还有这个
Invoke-Command C:\MyDirectory\MyCommand.cmd
Run Code Online (Sandbox Code Playgroud)
导致此错误:
Invoke-Command : Parameter set cannot be resolved using the specified named
parameters.
Run Code Online (Sandbox Code Playgroud)
我不需要将任何参数传递给PowerShell脚本.我正在寻找的正确语法是什么?
尝试调用cmd /c C:\MyDirectory\MyCommand.cmd- 这应该工作.
| 归档时间: |
|
| 查看次数: |
70753 次 |
| 最近记录: |