Page 2 of 2

Re: NSCP Settings Escape Character

Posted: Tue Dec 03, 2019 4:21 pm
by TechnicallyTrue
Interesting... It does work from command prompt, but not from powershell. I wonder if I have to escape all the quotation marks in powershell using the ` character as well.
I'll try that and get back to you.

Re: NSCP Settings Escape Character

Posted: Tue Dec 03, 2019 4:22 pm
by scottwilkerson
TechnicallyTrue wrote:Interesting... It does work from command prompt, but not from powershell. I wonder if I have to escape all the quotation marks in powershell using the ` character as well.
I'll try that and get back to you.
Probably you will have some other powershell escaping to do.

Best of luck!

Re: NSCP Settings Escape Character

Posted: Tue Dec 03, 2019 4:54 pm
by TechnicallyTrue
Sure enough, the quotation marks needed to be escaped twice, once for nscp settings and once for powershell. The final command reads as follows:

Code: Select all

& .\nscp settings --path `"/settings/scheduler/schedules`" --key `"Drive Space C:`" --set `"check_drivesize `"`"warn=free<10G and free<10%`"`" `"`"crit=free<5G and free<5%`"`" drive=c: show-all`"
Seems to work now. Thank you very much for your help.

Re: NSCP Settings Escape Character

Posted: Tue Dec 03, 2019 4:57 pm
by scottwilkerson
TechnicallyTrue wrote:Sure enough, the quotation marks needed to be escaped twice, once for nscp settings and once for powershell. The final command reads as follows:

Code: Select all

& .\nscp settings --path `"/settings/scheduler/schedules`" --key `"Drive Space C:`" --set `"check_drivesize `"`"warn=free<10G and free<10%`"`" `"`"crit=free<5G and free<5%`"`" drive=c: show-all`"
Seems to work now. Thank you very much for your help.
Great! Glad to hear you got it working!

Locking thread