...
The JobScheduler CLI is used for JobScheduler instances that are installed
locally or on remote computers and is initialized by the following commands:
- Import Module
Import-Module JobScheduler
- makes the module available in a PowerShell session.
- loads the module from a location that is available with the PowerShell module path,
- see $env:PSModulePath for predefined module locations.
Import-Module c:\some_module_location\JobScheduler
- loads the module from a specific location, absolute and relative paths can be used.
- Use JobScheduler Master instance
Use-Master JobSchedulerID
- as a first operation after importing the module it is required to execute the Use-Master cmdlet.
- The JobScheduler ID is determined during setup and is added to the installation path:
- A typical base bath would be C:\Program Files\sos-berlin.com\jobscheduler
- The path is added the subdirectory with the name of the JobScheduler ID
Use-Master -InstallPath "C:\Program Files\sos-berlin.com\jobscheduler\scheduler110"
- for local JobScheduler instances the installation path can be specified.
Use-Master -InstallPath $env:SCHEDULER_HOME
- It is recommended to create an environment variable SCHEDULER_HOME that points to the installation path.
- The JobScheduler CLI module on import checks availability of this environment variable
- The Use-Master cmdlet is executed automatically if SCHEDULER_HOME is present.
- Manage JobScheduler objects
Show-Status
- shows the summary information for a JobScheduler Master
Get-Order, Get-JobChain, Get-Job, Get-Tasks
- retrieves the list of avaiable objects
- see complete list of cmdlets with the cmdlet: Get-Command -Module JobScheduler
...
- Makes the JobScheduler Master with ID "
scheduler111
" available for use with cmdlets.PS C:\> Use-Master scheduler111
- Show the summary information of a JobScheduler Master.
PS C:\> Show-Status
- Show the number of tasks that are currently running.
PS C:\> (Get-Task).count
- Stop all running tasks (emergency stop).
PS C:\> Get-Task | Stop-Task
- Collect the list of orders from a directory and stores it in a variable.
PS C:\> $orders = Get-Order /sos
For more information about JobScheduler cmdlets, type: Get-Help Use-Master -detailed, Get-Help Show-Status -detailed
etc.
EXAMPLES
Find some typical use cases for the JobScheduler CLI.
...