Skip to main content

PowerShell script exit code not recognized

  • February 18, 2025
  • 0 replies
  • 16 views

Dagný Björk Stefánsdóttir
Contributor

Symptoms

Error while executing a PowerShell script via TimeXtender Orchestration. The script does not recognize exit codes correctly, leading to incorrect execution status.

Error: PowerShell script exit code not recognized.

Cause

The issue arises because TimeXtender Orchestration does not correctly interpret exit codes (exit 0 for success and exit 1 for failure) in PowerShell scripts.

Resolution

To ensure that the PowerShell script fails correctly, use the following syntax to trigger a failure:

  • Replace exit 1 with throw "ErrorText"

Steps:

  1. Modify your PowerShell script to use throw "ErrorText" instead of exit 1.
  2. This will ensure that TimeXtender Orchestration recognizes the script as failed when an error occurs.
Did this topic help you find an answer to your question?

0 replies

Be the first to reply!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings