Details
-
Fix
-
Status: Released (View Workflow)
-
Minor
-
Resolution: Fixed
-
1.10, 1.11
Description
Current Situation
- When a PowerShell job executes a Windows command (not: PowerShell cmdlet) and an error is raised then PowerShell sets the $LastExitCode variable.
- The value of this variables is not considered, i.e. jobs are treated as being successful in spite of this variable being set to a non-zero value.
- A sample job that shows this problem looks like this:
<job order="yes" stop_on_error="no" process_class="Agent_01"> <script language="powershell"> <![CDATA[ hostname hallo ]]> </script> <run_time /> </job>
Desired Behavior
- JobScheduler should consider the value of the LastExitCode variable:
- $LastExitCode = 0 signals success
- $LastExitCode != 0 signals error