Executing a Script
  • 1 Minute to read
  • Dark
    Light
  • PDF

Executing a Script

  • Dark
    Light
  • PDF

Article summary

Triggering a Script through Events

This article focuses on the manual execution of a script. If you would like to learn about executing scripts through events, check out the event triggers help article.

Manual Execution

On the script details page, the side panel has a button named "Execute Script". Click on this button and you will be presented with the following modal window:

The window above will show some basic information about the script prior to executing it. When you execute the script using the "Execute" button on the top right, the name of the window will change to "Executing..." while the script processes. After the script finishes processing, additional information will be shown with the results:

You can show or hide the additional details using the "Hide/Show additional execution details..." link. The execution results at the bottom will provide you with any output that the script produces. The output ranges from helpful context that you add to your scripts using the `Write-Output` PowerShell command to any errors that were encountered during execution. The execution results of any execution of a script (manual or by a trigger) can be found on the execution results tab. This is helpful for iterative development, historical purposes, and for troubleshooting any issues.

Script Execution Exit Codes

All scripts will produce an exit code per the following table. All non-zero exit codes are considered errors.

Code

Description

0

The script executed successfully without reporting any pipeline issues.

-1

There was an uncaught exception of some kind. The additional information text will provide context to the problem. The majority of issues captured in this category are usually from syntax errors, command parameter violations, or model definition problems (i.e., the system expected a certain type of model input for an object that wasn't provided).

-2

There was a scripting pipeline failure: Either the script timed out (a script cannot run longer than 60 seconds), the scripting service is unavailable, or there was a catastrophic issue that could not be captured in the output for some reason. If the problem is unknown, contact support to determine if something can be found through the service logs.

-3

The script is disabled.

-4

The script is locked from execution.

-9

The scripting service is disabled.


What's Next