0

I have a short script that prints out an argument being sent to it.

Suppose I send over "print this", no matter what I do it always prints out only "print". I have tried with either powershell or batch - same result. I also tried in Test Mode and it's the exact same issue.

Has anyone ever came across this?

JustAGuy
  • 629
  • 3
  • 18
  • 35
  • 3
    Have you [seen this FAQ](https://www.nsclient.org/nscp/wiki/FAQ#a5.HowdoIproperlyescapespacesinstrings)? Also, it may be easier to assist if you provide some of your script, in particular the section which is not working. – jscott Feb 19 '14 at 18:01

1 Answers1

1

This was my problem, I forgot to add double quotes to the arguments IN the NSCLIENT itself. FACE PALM

Just for a reference:

test = cmd /c echo scripts\\test.ps1 $ARG1$; exit($lastexitcode) | powershell.exe -command -

Should be:

test = cmd /c echo scripts\\test.ps1 "$ARG1$"; exit($lastexitcode) | powershell.exe -command -
jscott
  • 24,204
  • 8
  • 77
  • 99
JustAGuy
  • 629
  • 3
  • 18
  • 35