Have KACE script fail if powershell script fails

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.

0 Comments   [ + ] Show comments

Answers (1)

Answer Summary:
Posted by: torstenspitz 1 year ago
Yellow Belt

Top Answer

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}

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