Versions Compared

Key

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

Table of Contents
outlinh1. true
outlinh1. true
1printablefalse
2stylh1. none
3indent20px

PowerShell Scripting

PowerShell is a scripting is the Scripting shell of the Windows world. A PowerShell script can be used in Jobs jobs as easy as other shell scripts.

...

Code Block
 <job title="Execute a PowerShell Script" order="yes" stop_on_error="no">
     <script language="shell"><![CDATA[
 echo SCHEDULER_DATA = %SCHEDULER_DATA%
 echo SCHEDULER_PARAM_SCRIPT_FILENAME = %SCHEDULER_PARAM_SCRIPT_FILENAME%
 
 powershell.exe get-ExecutionPolicy
 powershell.exe -nologo -NonInteractive -noprofile -file "%SCHEDULER_PARAM_SCRIPT_FILENAME%" "%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>

...

Code Block
 C:\Program Files (x86)\scheduler>echo SCHEDULER_DATA = C:/Program Files (x86)/scheduler  
 SCHEDULER_DATA = C:/Program Files (x86)/scheduler 
  
 C:\Program Files (x86)\scheduler>echo SCHEDULER_PARAM_SCRIPT_FILENAME = C:/Program Files (x86)/scheduler\config\live\PowerShell\Powershell-Hallo.ps1  
 SCHEDULER_PARAM_SCRIPT_FILENAME = C:/Program Files (x86)/scheduler\config\live\PowerShell\Powershell-Hallo.ps1 
  
 C:\Program Files (x86)\scheduler>powershell get-ExecutionPolicy 
 SCHEDULER-918  state=release
 RemoteSigned 
  
 C:\Program Files (x86)\scheduler>powershell -noprofile \
 -file "C:/Program Files (x86)/scheduler\config\live\PowerShell\Powershell-Hallo.ps1" \
 "C:/Program Files (x86)/scheduler\config\live\PowerShell\Powershell-Hallo.ps1"  
 Hello, PowerShell ... 
 Num Args: 1
 Arg: C:/Program Files (x86)/scheduler\config\live\PowerShell\Powershell-Hallo.ps1
 Environment-var Scheduler-Data is : C:/Program Files (x86)/scheduler
 Operating system is               : Windows_NT
  
 C:\Program Files (x86)\scheduler>exit 0 

...

Related Downloads

see also:

...

See also