Skip to end of metadata
Go to start of metadata

Update Information

Icon
  • This article is deprecated and applies to JobScheduler releases up to 1.9
  • Starting from JobScheduler Release 1.10.5 native support for PowerShell is available
  • For detailed information see PowerShell Jobs
    FEATURE AVAILABILITY STARTING FROM RELEASE 1.10.5

Setting parameters in a PowerShell script and passing them to the next step

At every change of status in job chains Job Scheduler parses a temporary file for name=value pairs. The name/value pairs will be set as order parameters for subsequent jobs. The name of the temporary file is available with the environment variable SCHEDULER_RETURN_VALUES. See also How to pass parameters to subsequent jobs in a job chain for an example how to pass parameters between shell jobs.

The example below describes a job chain with two steps. Both are running the generic job presented in How to configure a generic PowerShell job to execute a PowerShell script within JobScheduler.

First Step: set a parameter for the next step in the job chain

Sample script: powershell_with_parameter_set.ps1

Second Step: get the parameter from the previous step

Sample script: powershell_with_parameter_get.ps1

Job Chain

 

The xml representation of the job chain:

 

Click the parameter button shown in the image above to specify the parameters for the selected job chain node.

The parameter for the first step:

 

The parameter for the second step:

 

The parameters for the job chain nodes are defined in a separated configuration file:

Related Downloads