/build/static/layout/Breadcrumb_cap_w.png

Scripting Question


Have KACE script fail if powershell script fails

09/14/2020 260 views

We use write-host a lot to log what happened in a script.

Is there a way to force KACE to state the script failed based on a Powershell script check?

e.g. PS script checks for a file version. If that version is not correct then it shows in KACE that script failed.

Answer Summary:
0 Comments   [ + ] Show comments

Comments


Answer Chosen by the Author

1

Run the powershell script in a verify step.

Exit 0 if successful or Exit 1 to have the Verify step fail. In Remediation you then can set the script to always fail.


if(Condition) {exit 0}else{exit 1}


Answered 09/14/2020 by: torstenspitz
Yellow Belt

 
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