Having issue with sending powershell a variable.
Posted: Thu May 25, 2017 1:44 pm
I am trying to run a powershell command to a windows box using NRPE
my nsclient.ini i have:
at the command line of the XI server is enter:
the output I get is:
In trying to figure this out, at the very begging of the powershell i have:
that way I can see what value is being passed.
and instead of the number 33, it is passing and single $ sign
I have retyped the ini line many times in thinking that maybe a hidden character had gotten there some how..... and no luck
Can you see what boneheaded thing i did??
my nsclient.ini i have:
Code: Select all
check_updates=cmd /c echo scripts\Check-Updates.ps1 $ARG1$; exit $LastExitCode | powershell.exe -command -Code: Select all
./check_nrpe -H g1vpskparc01 -t 120 -c check_updates 33Code: Select all
'GracePeriod'. Cannot convert value "$" to type "System.Int32". Error: "Input
string was not in a correct format."
At C:\Program Files\NSClient++\scripts\Check-Updates.ps1:92 char:33
+ $UpdateTime = Check-LastUpdate $GracePeriod
+ ~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Check-LastUpdate], ParameterBi
ndingArgumentTransformationException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,Check-LastU
pdate
Code: Select all
param($warn)
$output1 = $warn | out-file c:\scripts\grace.txt
and instead of the number 33, it is passing and single $ sign
I have retyped the ini line many times in thinking that maybe a hidden character had gotten there some how..... and no luck
Can you see what boneheaded thing i did??