...
Acessing parameters, comming from an order or a job, by environment variables makes it easy to use a generic job for executing powershell scripts. the order- (or job-) parameters has to specifiy the name of the script and some more parameters, which will be accessed then by the powershell script.
Code Block |
---|
<job <[http://www.sos-berlin.com/doc/en/scheduler.doc/xml/job.xml job ]title="Execute a PowerShell Script" order="yes" stop_on_error="no"> <script <[http://www.sos-berlin.com/doc/en/scheduler.doc/xml/script.xml script ]language="shell"> <![CDATA[<i> powershell -nologo -NonInteractive -noprofile -file "%SCHEDULER_PARAM_SCRIPT_FILENAME%" exit %errorlevel% </i> ]]> </script> <monitor <[http://www.sos-berlin.com/doc/en/scheduler.doc/xml/monitor.xml monitor ]name="configuration_monitor" ordering="0"> <script <[http://www.sos-berlin.com/doc/en/scheduler.doc/xml/script.xml script ]java_class="sos.scheduler.managed.configuration.ConfigurationOrderMonitor" language="java"/> </monitor> <run_time <[http://www.sos-berlin.com/doc/en/scheduler.doc/xml/run_time.xml run_time]/> </job> |
see also:
- How to execute a PowerShell script with JS
- Setting the executionPolicy to execute .ps1-scripts
- How to get the Exit code of a powershell script
- How to pass variable-values from JS to a powershell script
...