Shell: PowerShell CL_INT Uproc does not fail when PS code catches error
search cancel

Shell: PowerShell CL_INT Uproc does not fail when PS code catches error

book

Article ID: 219613

calendar_today

Updated On:

Products

CA Automic Dollar Universe

Issue/Introduction

Even though PowerShell code sets:

$env:RESEXE = 1 

the Uproc shows Completed status.

How do you get a CL_INT Urpoc with Shell PowerShell to fail?

Environment

Release : 6.x and 7.x

Component : DOLLAR UNIVERSE

OS: Windows

Shell: Powershell

Cause

Faulty scripting

Resolution

Use the following to close/stop a script:

#Always call one of the Stop-Scripts before exiting a powershell script.
function Stop-Script()
{
exit $env:RESEXE
}