Pre-Execution and Post-Execution Functions

The Security Controls script engine executes the script in parallel against multiple target machines. Sometimes you may want to do some setup operations on the console computer prior to executing the script and/or some finalization operations after all machines are complete. To specify the setup operations, include a function named “ST ConsoleBegin” within your script. This function will be called before the script is executed against any target machines. To specify finalization operations, include a function named “ST ConsoleEnd” within your script. This function will be called after the main script is executed against all target machines.

These functions must take zero parameters and be formatted as follows:

function ST-ConsoleBegin

{

#body of function indented from left margin

}

function ST-ConsoleEnd

{

#body of function indented from left margin

}

The function declarations and the opening and closing braces must begin in column 1. All other lines of the functions should not begin in column 1.

These functions are executed on the console only. Therefore, it is generally not necessary to use the ComputerName or Credential parameters on any of the cmdlets invoked in these functions.