Shell Scripts
A Shell script (.ps1) must be run on a Unix like system (Linux, MacOS, Docker etc) and can be used for a:
Exit Codes
Exit codes are used when executing a Shell script to determine the result of the execution.
In a Flow
When using in a flow, the exit code will correspond to the output, for example:
Exit Code | Description |
---|---|
0 | Complete the flow, stop execution |
1 | Output 1 |
2 | Output 2 |
Unknown | If the exit code is out of range of the defined outputs, then this will be treated as a failure |
Variables
In a flow Variables can be used, these will be basic string replacements, which will be done to the script code before creating the .bat file.
Variables can be used using {VariableName}
, for example
# Replace {file.FullName} and {file.Orig.FullName} with actual values
WorkingFile="{file.FullName}"
OriginalFile="{file.Orig.FullName}"
# Example commands using the variables
echo "Working on file: $WorkingFile"
echo "Original file location: $OriginalFile"
# Set the exit code to
exit 1
In a Pre-Execute Script
When using in a Pre-Execute Script:
Exit Code | Description |
---|---|
1 | Success, can process a file |
Other | Failure, will not process a file |