我有一个简短的脚本,打印出一个参数发送给它。
假设我发过来“打印这个”,不pipe我做什么,总是只打印出“打印”。 我曾尝试与PowerShell或批处理 – 相同的结果。 我也试过在testing模式,这是完全相同的问题。
有没有人遇到过这个?
这是我的问题,我忘了给NSCLIENT本身的参数添加双引号。 FACE PALM
仅供参考:
test = cmd /c echo scripts\\test.ps1 $ARG1$; exit($lastexitcode) | powershell.exe -command -
应该:
test = cmd /c echo scripts\\test.ps1 "$ARG1$"; exit($lastexitcode) | powershell.exe -command -