...
Accessing parameters, coming from an order or a job, by environment variables makes it easy to use a generic job for executing PowerShell scripts. The order - (parameters or job -) parameters has have to specify the name of the script and some more parameters , which that will be accessed then by passed to the PowerShell script.
Code Block | ||
---|---|---|
| ||
<job title="Execute a PowerShell Script" order="yes" stop_on_error="no"> <script language="shell"> <![CDATA[ powershell -nologo -NonInteractive -noprofile -file "%SCHEDULER_PARAM_SCRIPT_FILENAME%" exit %errorlevel% ]]> </script> <monitor name="configuration_monitor" ordering="0"> <script java_class="sos.scheduler.managed.configuration.ConfigurationOrderMonitor" language="java"/> </monitor> <run_time/> </job> |
The <monitor>
used in this example is needed required for parameter substitution of the order - parameters.related downloads
Related Downloads:
...
See also
...
- How to execute a PowerShell script with JSJobScheduler
- Setting the executionPolicy to execute .ps1-scripts
- How to get the Exit Code of a PowerShell Script
- How to pass variable-values parameters from JS JobScheduler to a powershell PowerShell script
- Passing Parameters to shell-jobs
- Passing parameters from shell-jobs to JS
- How to pass parameters to subsequent shell jobs in a job chain
- Example for a generic shell job passing the shell script to execute as a job parameter
- Example for control of How to control the process flow of a jobchain job chain by exit codes