【发布时间】:2013-09-06 15:18:00
【问题描述】:
我正在尝试使用 Powershell 远程运行脚本,该脚本仍在运行,但我收到错误 Invoke Command : Window Title cannot be longer than 1023 characters.
这是我的代码:
Invoke-Command -ComputerName Test -FilePath "\\Some\File\Path.ps1"
我意识到在 ISE 中运行该行时会发生什么,它将脚本的 comments in the header 放入文件名中。有没有办法阻止这种行为?我可以使用选项ErrorAction SilentlyContinue 来抑制错误,但它也会抑制所有其他不理想的错误。
【问题讨论】:
标签: powershell windows-server-2008 powershell-2.0 powershell-3.0 invoke-command