/build/static/layout/Breadcrumb_cap_w.png

Have KACE Online shell script (Powershell) return failed

I am running a PowerShell script using a KACE shell script. I would like to check for a condition and if the condition is true do something, else throw an error.  When the error is thrown I would like for it to report in KACE in the run now section as failed. Right now it always reports as a success just telling me that the script was able to execute. Is there a way for me to throw an error from PowerShell that Kace will interpret as a failed run? I am able to do this in an online Kscript by using 'exit 1' in the PS script which Kace sees as failed, but it doesn't seem to work for the shell script.


0 Comments   [ + ] Show comments

Answers (1)

Posted by: Mashby1 1 month ago
Yellow Belt
0

If I am understanding correctly, you are seeing the "reports as successful" from the "run now status" screen. This is sometimes confusing as unless the script could not run (ie. computer offline, or could not find the script or something) it will always report successful in that screen because technically it ran. 
If I am correct in thinking this is what you are talking about, have you looked at the log for the information you are after? You get to it by clicking on the job time in the "run now status" screen after it is successful and expanding the "successful execution" section and clicking on the" view logs" next to the device you wish to see more about. Any output you have configured should show there. 

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ