Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The sample below describes a job chain with two steps. Both are running the generic job PowerShellExecutor to run a powershell script within a JobScheduler job.

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

Code Block
 $A="myParam=PowerShellParam"
 $A | out-file -encoding ASCII $env:scheduler_return_values
 get-content $env:scheduler_return_values
 exit $lastexitcode
Code Block
 # to change the policy for using powershell you can use this .adm file:
 #    http://www.microsoft.com/download/en/confirmation.aspx?id=25119

Second Step: get the parameter sets in the first step

Code Block
 "the parameter from the previous job chain node is '$env:SCHEDULER_PARAM_myParam'"
 exit $lastexitcode
Code Block
 # to change the policy for using powershell you can use this .adm file:
 #    http://www.microsoft.com/download/en/confirmation.aspx?id=25119

Job Chain

Code Block
 <job_chain>
    <job_chain_node state="100" job="PowerShellExecutor" next_state="150" error_state="error"/>
    <job_chain_node state="150" job="PowerShellExecutor" next_state="200" error_state="error"/>
    <job_chain_node state="success"/>
    <job_chain_node state="error"/>
 </job_chain>

related downloads:

...