Setting Pre and Post Scripts

Pre and post scripts provide the ability to setup an environment before running the task and to cleanup that environment upon task completion. The post script also provides the ability to do analysis of the task upon completion and possibly alter the status. It could also capture additional output for the task.

See Agent Scripting Methods for options.

Field Description
Pre Script check box

Check the Pre Script check box to specify a script to run before the task executes.

  1. Select the script language you are using from the dropdown list. These are the valid options:
  2. JavaScript
    PythonScript
  3. Enter the script. Click the Pencil () icon to display the Edit Script dialog box if required.
Post Script check box

Check the Post Script check box to specify a script to run after the task executes.

Specify or enter the script as described for the Pre Script option.

Get Script from file check box Select the Get Script from file check box and enter the fully qualified path to the file containing the script in the Filename field.
Always run script check box Select the Always run script check box if you want the specified script to run when the task completes regardless of the status. Otherwise, the script will only run if the task complete successfully.
Not supported on all task service types.