Versions Compared

Key

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

Table of Contents

Download

The PowerShell Command Line Interface is available from GitHub at https://github.com/sos-berlin/scheduler-cli-powershell

Short Description

TOPIC

about_JobScheduler

...

The JobScheduler Command Line Interface (CLI) can be used to control
JobScheduler control JobScheduler instances (start, stop, status) and job-related objects
such objects such as jobs, job chains, orders, tasks.

The JobScheduler CLI module supports Windows PowerShell 23.0 and abovenewer.LONG DESCRIPTION

Long Description

The JobScheduler Command Line Interface (CLI) is used for the following
areas of operation:

  • work as a replacement for

...

  • command scripts
    • JobScheduler start script .\bin\jobscheduler.cmd:
      • provide operations for installing and removing the JobScheduler Windows service
      • starting and stopping JobScheduler instances including active and passive clusters

...

    • Job Editor (JOE) start script .\bin\jobeditor.cmd
    • JobScheduler Dashboard (JID) start script .\bin\dashboard.cmd
    • JobScheduler Event script .\bin\jobscheduler_event.cmd
  • provide bulk operations:
    • select jobs, job chains, orders and tasks
    • manage orders with operations for start, stop and removal
    • suspend and resume jobs, job chains and orders
    • terminate tasks
  • schedule jobs and orders:
    • add orders to job chains

run PowerShell cmdlets and functions on-the-fly as JobScheduler jobs

    • start jobs and orders
  • manage Agents
    • retrieve Agent clusters
    • check Agent status

The JobScheduler CLI provides a number of cmdlets, see PowerShell CLI 1.1 - Cmdlets

  • The complete list of cmdlets is available with the command:

      ...

        • PS C:\> Get-Command -Module JobScheduler
      • Cmdlets come with a full name

      ...

      • that includes the term JobScheduler:
        • PS C:\> Use-JobSchedulerWebService
      • The term JobScheduler can be abbreviated to JS:
        • PS C:\> Use-JSWebService
      • The term JobScheduler can further be omitted if the resulting alias does not conflict with existing cmdlets:
        • PS C:\> Use-WebService

      The full name includes the term "JobScheduler" such as in

      ...

      • Should conflicts occur with existing cmdlets from other modules then

      ...

      • no conflicting aliases are created. This includes aliases for cmdlets from the PowerShell Core as e.g. Get-Job, Start-Job, Stop-Job.
        It is recommended to use the abbreviated form Get-JSJob, Start-JSJob etc. Aliases can be forced by use of the cmdlet:
        • PS C:\> . Use-JobSchedulerAlias

      Cmdlets consider verbosity and debug settings.

      • This will cause verbose output to be created from cmdlets:
        • PS C:\> $VerbosePreference = "Continue"
      • The verbosity level is reset with:
        • PS C:\> $VerbosePreference

      Remove-Item alias:Use-Master

      Cmdlets consider verbosity and debug settings.

      This will cause verbose output to be created from cmdlets:

      $VerbosePreference = "Continue"

      The verbosity level is reset with:

      ...

        • = "SilentlyContinue"
      • This will cause debug output to be created from cmdlets:

          ...

            • PS C:\> $DebugPreference = "Continue"
          • The debug level is reset with:

              ...

                • PS C:\> $DebugPreference = "SilentlyContinue"

              The responses from a JobScheduler Master can include large XML answers.
              Such answers are stored in temporary files, the debug message indicates the location of the file name.
              The threshold for creating temporary files is 1000 bye byte by default.
              Consider use of the Set-JobSchedulerOption -MaxOutputSize DebugMaxOutputSize cmdlet to change this value.

              HOW TO GET STARTED WITH THE JobScheduler CLI?

              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_location\JobScheduler

              loads the module from a specific location, absolute and relative paths can be used.

              Use JobScheduler Master instance

              Use-Master JobScheduler ID

              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

              HOW TO RUN JobScheduler COMMANDS

              JobScheduler commands are Windows PowerShell scripts (.ps1 files), so you can run
              them at the command line, or in any editor.

              PS C:\> Use-Master scheduler111

              Makes the JobScheduler Master with ID "scheduler111" available for use with cmdlets.

              PS C:\> Show-Status

              Shows the summary information of a JobScheduler Master.

              PS C:\> (Get-Task).count

              Shows the number of tasks that are currently running.

              PS C:\> Get-Task | Stop-Task

              Stops all running tasks (emergency stop).

              PS C:\> $orders = Get-Order /sos

              Collects the list of orders from a directory and stores it in a variable.

              For more information about JobScheduler cmdlets, type: Get-Help Use-Master, Get-Help Show-Status etc.

              EXAMPLES

              Find some typical use cases for the JobScheduler CLI.

              Perform an emergency stop:

              Get-Task | Stop-Task -Action kill

              This will terminate all running and enqueued tasks immediately.

              Find enqueued tasks, i.e. tasks that are scheduled for a later start:

              Get-Task -NoRunningTasks

              Retrieves the list of scheduled tasks.

              Suspend any temporary orders that are e.g. created by job scripts:

              $orders = ( Get-Order /my_jobs -NoPermanent | Suspend-Order )

              This will retrieve temporary ad hoc orders from the "my_jobs" directory and any subfolders.
              All temporary orders are suspended and the list of order objects is stored in a variable.

              Remove orders from a list that have previously been retrieved

              $orders | Remove-Order

              This will remove the orders available from the list.

              MANAGING THE JobScheduler MASTER

              Find some use cases for JobScheduler Master management.

              Start the JobScheduler Master:

              Start-Master -Service

              Starts the Windows service of a JobScheduler Master

              Start the JobScheduler Master in paused mode:

              Start-Master -Service -Pause

              The Windows service is started and immediately paused to prevent any tasks from starting.

              Restart the JobScheduler Master:

              Restart-Master -Timeout 120

              Restarts the Master having left any running tasks up to 120 seconds to complete.

              Stop the JobScheduler Master immediately:

              Stop-Master -Action kill

              This will kill all running tasks immediately and terminate the JobScheduler Master.

              Stop the JobScheduler Master cluster:

              Stop-Master -Cluster -Action abort

              Install the JobScheduler Master Windows service:

              Install-Service -Start -PauseAfterFailure

              Installs and starts the Windows service. Should a previous JobScheduler run
              have been terminated with failure then JobScheduler Master will switch to pause mode.
              This allows e.g. to check for enqueued tasks before starting operations.
              A previously installed Windows service with the same name will be removed.

              Install the JobScheduler Master Windows service for a specific account:

              Install-Service -Start -UseCredentials

              This will install the service and ask for the name of the account and password
              that the service is operated for. The account name typically includes the
              domain and user, e.g. .\some_user for "some_user" in the current domain.

              Remove the JobScheduler Master Windows service:

              Remove-Service

              This will remove the Windows service. Should any tasks be running with the
              JobScheduler Master then the removal will be delayed. Consider to use

              Stop-Master -Action abort

              if immediate removal of the Windows service is required.

              SEE ALSO
              JobScheduler wiki: https://kb.sos-berlin.com/display/PKB/JobScheduler
              Get-Calendar
              Get-Job
              Get-JobChain
              Get-Order
              Get-Status
              Get-Task
              Get-Version
              Install-Service
              Remove-Order
              Remove-Service
              Reset-Order
              Restart-Master
              Resume-Master
              Resume-Order
              Send-Command
              Set-MaxOutputSize
              Show-Calendar
              Show-Status
              Start-Master
              Start-Job
              Start-Order
              Stop-Job
              Stop-Master
              Stop-Task
              Suspend-Master
              Suspend-Order
              Update-Job
              Update-Order
              Use-Master

              "@

              TOPIC

              about_JobScheduler

              SHORT DESCRIPTION

              The JobScheduler Command Line Interface (CLI) can be used to control
              JobScheduler instances (start, stop, status) and job-related objects
              such as jobs, job chains, orders, tasks.

              The JobScheduler CLI module supports Windows PowerShell 2.0 and above.

              LONG DESCRIPTION

              The JobScheduler Command Line Interface (CLI) is used for the following
              areas of operation:

              work as a replacement for the command script .bin\jobscheduler.cmd:

              provide operations for installing and removing the JobScheduler Windows service

              starting and stopping JobScheduler instances including active and passive clusters

              provide bulk operations:

              select jobs, job chains, orders and tasks

              manage orders with operations for start, stop and removal

              terminate tasks

              schedule jobs and orders:

              add orders to job chains

              run PowerShell cmdlets and functions on-the-fly as JobScheduler jobs

              The JobScheduler CLI provides a number of cmdlets.

              The complete list of cmdlets is available with the command:

              Get-Command -Module JobScheduler

              Cmdlets come with a full name and a short alias:

              The full name includes the term "JobScheduler" such as in

              Use-JobSchedulerMaster
              Use-Master

              Should conflicts occur with existing modules then the aliases can be removed

              Remove-Item alias:Use-Master

              Cmdlets consider verbosity and debug settings.

              This will cause verbose output to be created from cmdlets:

              $VerbosePreference = "Continue"

              The verbosity level is reset with:

              $VerbosePreference = "SilentlyContinue"

              This will cause debug output to be created from cmdlets:

              $DebugPreference = "Continue"

              The debug level is reset with:

              $DebugPreference = "SilentlyContinue"

              The responses from a JobScheduler Master can include large XML answers.
              Such answers are stored in temporary files, the debug message indicates the file name.
              The threshold for creating files is 1000 bye by default.
              Consider use of the Set-MaxOutputSize cmdlet to change this value.

              HOW TO GET STARTED WITH THE JobScheduler CLI?

              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_location\JobScheduler

              loads the module from a specific location, absolute and relative paths can be used.

              Use JobScheduler Master instance

              Use-Master JobScheduler ID

              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

              HOW TO RUN JobScheduler COMMANDS

              JobScheduler commands are Windows PowerShell scripts (.ps1 files), so you can run
              them at the command line, or in any editor.

              PS C:\> Use-Master scheduler111

              Makes the JobScheduler Master with ID "scheduler111" available for use with cmdlets.

              PS C:\> Show-Status

              Shows the summary information of a JobScheduler Master.

              PS C:\> (Get-Task).count

              Shows the number of tasks that are currently running.

              PS C:\> Get-Task | Stop-Task

              Stops all running tasks (emergency stop).

              PS C:\> $orders = Get-Order /sos

              Collects the list of orders from a directory and stores it in a variable.

              For more information about JobScheduler cmdlets, type: Get-Help Use-Master, Get-Help Show-Status etc.

              EXAMPLES

              Find some typical use cases for the JobScheduler CLI.

              Perform an emergency stop:

              Get-Task | Stop-Task -Action kill

              This will terminate all running and enqueued tasks immediately.

              Find enqueued tasks, i.e. tasks that are scheduled for a later start:

              Get-Task -NoRunningTasks

              Retrieves the list of scheduled tasks.

              Suspend any temporary orders that are e.g. created by job scripts:

              $orders = ( Get-Order /my_jobs -NoPermanent | Suspend-Order )

              This will retrieve temporary ad hoc orders from the "my_jobs" directory and any subfolders.
              All temporary orders are suspended and the list of order objects is stored in a variable.

              Remove orders from a list that have previously been retrieved

              $orders | Remove-Order

              This will remove the orders available from the list.

              MANAGING THE JobScheduler MASTER

              Find some use cases for JobScheduler Master management.

              Start the JobScheduler Master:

              Start-Master -Service

              Starts the Windows service of a JobScheduler Master

              Start the JobScheduler Master in paused mode:

              Start-Master -Service -Pause

              The Windows service is started and immediately paused to prevent any tasks from starting.

              Restart the JobScheduler Master:

              Restart-Master -Timeout 120

              Restarts the Master having left any running tasks up to 120 seconds to complete.

              Stop the JobScheduler Master immediately:

              Stop-Master -Action kill

              This will kill all running tasks immediately and terminate the JobScheduler Master.

              Stop the JobScheduler Master cluster:

              Stop-Master -Cluster -Action abort

              Install the JobScheduler Master Windows service:

              Install-Service -Start -PauseAfterFailure

              Installs and starts the Windows service. Should a previous JobScheduler run
              have been terminated with failure then JobScheduler Master will switch to pause mode.
              This allows e.g. to check for enqueued tasks before starting operations.
              A previously installed Windows service with the same name will be removed.

              Install the JobScheduler Master Windows service for a specific account:

              Install-Service -Start -UseCredentials

              This will install the service and ask for the name of the account and password
              that the service is operated for. The account name typically includes the
              domain and user, e.g. .\some_user for "some_user" in the current domain.

              Remove the JobScheduler Master Windows service:

              Remove-Service

              This will remove the Windows service. Should any tasks be running with the
              JobScheduler Master then the removal will be delayed. Consider to use

              Stop-Master -Action abort

              if immediate removal of the Windows service is required.

              SEE ALSO
              JobScheduler wiki: https://kb.sos-berlin.com/display/PKB/JobScheduler
              Get-Calendar
              Get-Job
              Get-JobChain
              Get-Order
              Get-Status
              Get-Task
              Get-Version
              Install-Service
              Remove-Order
              Remove-Service
              Reset-Order
              Restart-Master
              Resume-Master
              Resume-Order
              Send-Command
              Set-MaxOutputSize
              Show-Calendar
              Show-Status
              Start-Master
              Start-Job
              Start-Order
              Stop-Job
              Stop-Master
              Stop-Task
              Suspend-Master
              Suspend-Order
              Update-Job
              Update-Order
              Use-Master
              }

              function CreateContent( TOPIC

              about_JobScheduler

              SHORT DESCRIPTION

              The JobScheduler Command Line Interface (CLI) can be used to control
              JobScheduler instances (start, stop, status) and job-related objects
              such as jobs, job chains, orders, tasks.

              The JobScheduler CLI module supports Windows PowerShell 2.0 and above.

              LONG DESCRIPTION

              The JobScheduler Command Line Interface (CLI) is used for the following
              areas of operation:

              work as a replacement for the command script .bin\jobscheduler.cmd:

              provide operations for installing and removing the JobScheduler Windows service

              starting and stopping JobScheduler instances including active and passive clusters

              provide bulk operations:

              select jobs, job chains, orders and tasks

              manage orders with operations for start, stop and removal

              terminate tasks

              schedule jobs and orders:

              add orders to job chains

              run PowerShell cmdlets and functions on-the-fly as JobScheduler jobs

              The JobScheduler CLI provides a number of cmdlets.

              The complete list of cmdlets is available with the command:

              Get-Command -Module JobScheduler

              Cmdlets come with a full name and a short alias:

              The full name includes the term "JobScheduler" such as in

              Use-JobSchedulerMaster
              Use-Master

              Should conflicts occur with existing modules then the aliases can be removed

              Remove-Item alias:Use-Master

              Cmdlets consider verbosity and debug settings.

              This will cause verbose output to be created from cmdlets:

              $VerbosePreference = "Continue"

              The verbosity level is reset with:

              $VerbosePreference = "SilentlyContinue"

              This will cause debug output to be created from cmdlets:

              $DebugPreference = "Continue"

              The debug level is reset with:

              $DebugPreference = "SilentlyContinue"

              The responses from a JobScheduler Master can include large XML answers.
              Such answers are stored in temporary files, the debug message indicates the file name.
              The threshold for creating files is 1000 bye by default.
              Consider use of the Set-MaxOutputSize cmdlet to change this value.

              HOW TO GET STARTED WITH THE JobScheduler CLI?

              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_location\JobScheduler

              loads the module from a specific location, absolute and relative paths can be used.

              Use JobScheduler Master instance

              Use-Master JobScheduler ID

              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

              HOW TO RUN JobScheduler COMMANDS

              JobScheduler commands are Windows PowerShell scripts (.ps1 files), so you can run
              them at the command line, or in any editor.

              PS C:\> Use-Master scheduler111

              Makes the JobScheduler Master with ID "scheduler111" available for use with cmdlets.

              PS C:\> Show-Status

              Shows the summary information of a JobScheduler Master.

              PS C:\> (Get-Task).count

              Shows the number of tasks that are currently running.

              PS C:\> Get-Task | Stop-Task

              Stops all running tasks (emergency stop).

              PS C:\> $orders = Get-Order /sos

              Collects the list of orders from a directory and stores it in a variable.

              For more information about JobScheduler cmdlets, type: Get-Help Use-Master, Get-Help Show-Status etc.

              EXAMPLES

              Find some typical use cases for the JobScheduler CLI.

              Perform an emergency stop:

              Get-Task | Stop-Task -Action kill

              This will terminate all running and enqueued tasks immediately.

              Find enqueued tasks, i.e. tasks that are scheduled for a later start:

              Get-Task -NoRunningTasks

              Retrieves the list of scheduled tasks.

              Suspend any temporary orders that are e.g. created by job scripts:

              $orders = ( Get-Order /my_jobs -NoPermanent | Suspend-Order )

              This will retrieve temporary ad hoc orders from the "my_jobs" directory and any subfolders.
              All temporary orders are suspended and the list of order objects is stored in a variable.

              Remove orders from a list that have previously been retrieved

              $orders | Remove-Order

              This will remove the orders available from the list.

              MANAGING THE JobScheduler MASTER

              Find some use cases for JobScheduler Master management.

              Start the JobScheduler Master:

              Start-Master -Service

              Starts the Windows service of a JobScheduler Master

              Start the JobScheduler Master in paused mode:

              Start-Master -Service -Pause

              The Windows service is started and immediately paused to prevent any tasks from starting.

              Restart the JobScheduler Master:

              Restart-Master -Timeout 120

              Restarts the Master having left any running tasks up to 120 seconds to complete.

              Stop the JobScheduler Master immediately:

              Stop-Master -Action kill

              This will kill all running tasks immediately and terminate the JobScheduler Master.

              Stop the JobScheduler Master cluster:

              Stop-Master -Cluster -Action abort

              Install the JobScheduler Master Windows service:

              Install-Service -Start -PauseAfterFailure

              Installs and starts the Windows service. Should a previous JobScheduler run
              have been terminated with failure then JobScheduler Master will switch to pause mode.
              This allows e.g. to check for enqueued tasks before starting operations.
              A previously installed Windows service with the same name will be removed.

              Install the JobScheduler Master Windows service for a specific account:

              Install-Service -Start -UseCredentials

              This will install the service and ask for the name of the account and password
              that the service is operated for. The account name typically includes the
              domain and user, e.g. .\some_user for "some_user" in the current domain.

              Remove the JobScheduler Master Windows service:

              Remove-Service

              This will remove the Windows service. Should any tasks be running with the
              JobScheduler Master then the removal will be delayed. Consider to use

              Stop-Master -Action abort

              if immediate removal of the Windows service is required.

              SEE ALSO
              JobScheduler wiki: https://kb.sos-berlin.com/display/PKB/JobScheduler
              Get-Calendar
              Get-Job
              Get-JobChain
              Get-Order
              Get-Status
              Get-Task
              Get-Version
              Install-Service
              Remove-Order
              Remove-Service
              Reset-Order
              Restart-Master
              Resume-Master
              Resume-Order
              Send-Command
              Set-MaxOutputSize
              Show-Calendar
              Show-Status
              Start-Master
              Start-Job
              Start-Order
              Stop-Job
              Stop-Master
              Stop-Task
              Suspend-Master
              Suspend-Order
              Update-Job
              Update-Order
              Use-Master )
              {
              TOPIC

              about_JobScheduler

              SHORT DESCRIPTION

              The JobScheduler Command Line Interface (CLI) can be used to control
              JobScheduler instances (start, stop, status) and job-related objects
              such as jobs, job chains, orders, tasks.

              The JobScheduler CLI module supports Windows PowerShell 2.0 and above.

              LONG DESCRIPTION

              The JobScheduler Command Line Interface (CLI) is used for the following
              areas of operation:

              work as a replacement for the command script .bin\jobscheduler.cmd:

              provide operations for installing and removing the JobScheduler Windows service

              starting and stopping JobScheduler instances including active and passive clusters

              provide bulk operations:

              select jobs, job chains, orders and tasks

              manage orders with operations for start, stop and removal

              terminate tasks

              schedule jobs and orders:

              add orders to job chains

              run PowerShell cmdlets and functions on-the-fly as JobScheduler jobs

              The JobScheduler CLI provides a number of cmdlets.

              The complete list of cmdlets is available with the command:

              Get-Command -Module JobScheduler

              Cmdlets come with a full name and a short alias:

              The full name includes the term "JobScheduler" such as in

              Use-JobSchedulerMaster
              Use-Master

              Should conflicts occur with existing modules then the aliases can be removed

              Remove-Item alias:Use-Master

              Cmdlets consider verbosity and debug settings.

              This will cause verbose output to be created from cmdlets:

              $VerbosePreference = "Continue"

              The verbosity level is reset with:

              $VerbosePreference = "SilentlyContinue"

              This will cause debug output to be created from cmdlets:

              $DebugPreference = "Continue"

              The debug level is reset with:

              $DebugPreference = "SilentlyContinue"

              The responses from a JobScheduler Master can include large XML answers.
              Such answers are stored in temporary files, the debug message indicates the file name.
              The threshold for creating files is 1000 bye by default.
              Consider use of the Set-MaxOutputSize cmdlet to change this value.

              HOW TO GET STARTED WITH THE JobScheduler CLI?

              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_location\JobScheduler

              loads the module from a specific location, absolute and relative paths can be used.

              Use JobScheduler Master instance

              Use-Master JobScheduler ID

              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

              HOW TO RUN JobScheduler COMMANDS

              JobScheduler commands are Windows PowerShell scripts (.ps1 files), so you can run
              them at the command line, or in any editor.

              PS C:\> Use-Master scheduler111

              Makes the JobScheduler Master with ID "scheduler111" available for use with cmdlets.

              PS C:\> Show-Status

              Shows the summary information of a JobScheduler Master.

              PS C:\> (Get-Task).count

              Shows the number of tasks that are currently running.

              PS C:\> Get-Task | Stop-Task

              Stops all running tasks (emergency stop).

              PS C:\> $orders = Get-Order /sos

              Collects the list of orders from a directory and stores it in a variable.

              For more information about JobScheduler cmdlets, type: Get-Help Use-Master, Get-Help Show-Status etc.

              EXAMPLES

              Find some typical use cases for the JobScheduler CLI.

              Perform an emergency stop:

              Get-Task | Stop-Task -Action kill

              This will terminate all running and enqueued tasks immediately.

              Find enqueued tasks, i.e. tasks that are scheduled for a later start:

              Get-Task -NoRunningTasks

              Retrieves the list of scheduled tasks.

              Suspend any temporary orders that are e.g. created by job scripts:

              $orders = ( Get-Order /my_jobs -NoPermanent | Suspend-Order )

              This will retrieve temporary ad hoc orders from the "my_jobs" directory and any subfolders.
              All temporary orders are suspended and the list of order objects is stored in a variable.

              Remove orders from a list that have previously been retrieved

              $orders | Remove-Order

              This will remove the orders available from the list.

              MANAGING THE JobScheduler MASTER

              Find some use cases for JobScheduler Master management.

              Start the JobScheduler Master:

              Start-Master -Service

              Starts the Windows service of a JobScheduler Master

              Start the JobScheduler Master in paused mode:

              Start-Master -Service -Pause

              The Windows service is started and immediately paused to prevent any tasks from starting.

              Restart the JobScheduler Master:

              Restart-Master -Timeout 120

              Restarts the Master having left any running tasks up to 120 seconds to complete.

              Stop the JobScheduler Master immediately:

              Stop-Master -Action kill

              This will kill all running tasks immediately and terminate the JobScheduler Master.

              Stop the JobScheduler Master cluster:

              Stop-Master -Cluster -Action abort

              Install the JobScheduler Master Windows service:

              Install-Service -Start -PauseAfterFailure

              Installs and starts the Windows service. Should a previous JobScheduler run
              have been terminated with failure then JobScheduler Master will switch to pause mode.
              This allows e.g. to check for enqueued tasks before starting operations.
              A previously installed Windows service with the same name will be removed.

              Install the JobScheduler Master Windows service for a specific account:

              Install-Service -Start -UseCredentials

              This will install the service and ask for the name of the account and password
              that the service is operated for. The account name typically includes the
              domain and user, e.g. .\some_user for "some_user" in the current domain.

              Remove the JobScheduler Master Windows service:

              Remove-Service

              This will remove the Windows service. Should any tasks be running with the
              JobScheduler Master then the removal will be delayed. Consider to use

              Stop-Master -Action abort

              if immediate removal of the Windows service is required.

              SEE ALSO
              JobScheduler wiki: https://kb.sos-berlin.com/display/PKB/JobScheduler
              Get-Calendar
              Get-Job
              Get-JobChain
              Get-Order
              Get-Status
              Get-Task
              Get-Version
              Install-Service
              Remove-Order
              Remove-Service
              Reset-Order
              Restart-Master
              Resume-Master
              Resume-Order
              Send-Command
              Set-MaxOutputSize
              Show-Calendar
              Show-Status
              Start-Master
              Start-Job
              Start-Order
              Stop-Job
              Stop-Master
              Stop-Task
              Suspend-Master
              Suspend-Order
              Update-Job
              Update-Order
              Use-Master = @"

              NAME

              about_JobScheduler

              SYNOPSIS

              SHORT DESCRIPTION

              SYNTAX

              DESCRIPTION

              PARAMETERS

              The JobScheduler CLI is provided with the following features:

              • Jira
                serverSOS JIRA
                columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
                serverId6dc67751-9d67-34cd-985b-194a8cdc9602
                keyJS-1630
              • Jira
                serverSOS JIRA
                columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
                serverId6dc67751-9d67-34cd-985b-194a8cdc9602
                keyJS-1339
              • Jira
                serverSOS JIRA
                columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
                serverId6dc67751-9d67-34cd-985b-194a8cdc9602
                keyJS-1620
              • Jira
                serverSOS JIRA
                columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
                serverId6dc67751-9d67-34cd-985b-194a8cdc9602
                keyJS-1762


              How to get started with the JobScheduler CLI

              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
                • PS C:\> Import-Module JobScheduler
                  • loads the module from a location that is available with the PowerShell module path,
                  • see $env:PSModulePath for predefined module locations.
                • PS C:\> Import-Module C:\some_module_location\JobScheduler
                  • loads the module from a specific location, absolute and relative paths can be used.
                • Hints
              • Use JobScheduler Master Instance
                • As a first operation after importing the module it is required to execute the Use-JobSchedulerMaster or Use-JobSchedulerWebService (starting from release 1.11) cmdlets.
                • PS C:\> Use-JobSchedulerMaster <Url>   or   PS C:\> Use-JobSchedulerMaster -Url <Url>   or   PS C:\> Use-JobSchedulerWebService -Url <Url> -Id <JobSchedulerId>
                  • specifies the URL for which the JobScheduler Master or REST Web Service is available. This is the same URL that you would use when opening the JOC Cockpit GUI in your browser, e.g. http://localhost:4446. If you omit the protocol (HTTP/HTTPS) for the URL then HTTP will be used. The -Id parameter specifies the JobScheduler ID of the Master that you intend to connect to.
                  • allows to execute cmdlets for the specified Master independently from the server and operating system that the JobScheduler Master is operated for, i.e. you can use PowerShell cmdlets on Windows to manage a JobScheduler Master running on a Linux box and vice versa. As an exception to this rule you cannot start a remote JobScheduler Master and you cannot start a remote JobScheduler Windows service, however, you can restart, terminate, abort and suspend any JobScheduler Master on any platform.
                  • specifying the URL is not sufficient to manage the Windows Service of the respective Master, see below.
                • PS C:\> Use-JobSchedulerWebService -Url <Url> -Id <JobSchedulerID>
                  • references the JobScheduler ID that has been assigned during installation of a Master.
                  • adds the JobScheduler ID to the assumed installation base path.
                    • A typical base bath would be C:\Program Files\sos-berlin.com\jobscheduler
                    • The path is added the subdirectory with the value of the JobScheduler ID
                • PS C:\> Use-JobSchedulerMaster -InstallPath <InstallationPath>
                  • specifies the full installation path, e.g. C:\Program Files\sos-berlin.com\jobscheduler\scheduler1.10, for a locally available JobScheduler Master.
                • PS C:\> Use-JobSchedulerMaster -InstallPath $env:SCHEDULER_HOME
                  • You can use the environment variable SCHEDULER_HOME that points to the installation path.
                  • The JobScheduler CLI module on import checks availability of this environment variable.
                • PS C:\> Use-JobSchedulerMaster -Url <Url> -Id <JobSchedulerID>
                  • specify both URL and JobScheduler ID (recommended).
                  • determines if the Master with the specified JobSchedulerID is locally available.
                • Hints
              • Manage JobScheduler Objects
                • PS C:\> Show-JobSchedulerStatus
                  • shows the summary information for a JobScheduler Master
                • PS C:\> Get-JobSchedulerOrder
                  PS C:\> Get-JobSchedulerJobChain
                  PS C:\> Get-JobSchedulerJob
                  PS C:\> Get-JobSchedulerTask
                  • retrieves the list of avaiable objects
                • see the complete list of cmdlets with the cmdlet: Get-Command -Module JobScheduler

              How to run JobScheduler commands

              JobScheduler commands are Windows PowerShell scripts (.ps1 files), so you can run
              them at the command line, or in any editor.

              • Import the JobScheduler CLI module (assuming that the module is available in one of the directories that are indicated with the $env:PSModulePath.
                • PS C:\> Import-Module JobScheduler
              • Make the JobScheduler Master with JobScheduler ID scheduler111 available for use with cmdlets that are executed via the REST Web Services from the specified URL.
              • Display the summary information of a JobScheduler Master.
                • PS C:\> Show-JobSchedulerStatus
              • Display the number of tasks that are currently running.
                • PS C:\> (Get-JobSchedulerTask).count
              • Display all running tasks (emergency stop).
                • PS C:\> Get-JobSchedulerTask | Stop-JobSchedulerTask
              • Collect the list of orders from a directory and store it in a variable.
                • PS C:\> $orders = Get-JobSchedulerOrder /sos

              For more information about individual JobScheduler cmdlets, type:

              • Get-Help Use-JobSchedulerMaster -detailed
              • Get-Help Show-JobSchedulerStatus -detailed
              • etc.

              Examples

              Find some typical use cases for the JobScheduler CLI.

              • Perform an emergency stop:
                • Get-JobSchedulerTask | Stop-JobSchedulerTask
                • This will terminate all running and enqueued tasks immediately.
              • Find enqueued tasks, i.e. tasks that are scheduled for a later start:
                • Get-JobSchedulerTask -NoRunningTasks
                • Retrieves the list of scheduled tasks.
              • Suspend any temporary orders that are e.g. created by job scripts:
                • $orders = ( Get-JobSchedulerOrder /my_jobs -NoPermanent | Suspend-JobSchedulerOrder )
                • This will retrieve temporary ad hoc orders from the /my_jobs directory and any subfolders.
                • All temporary orders are suspended and the list of order objects is stored in a variable.
              • Remove orders based on a list that has previously been retrieved:
                • $orders | Remove-JobSchedulerOrder
                • This will remove the orders available from the list.

              Managing the JobScheduler Master

              Find some use cases for JobScheduler Master management.

              • Start the JobScheduler Master:
                • Start-JobSchedulerMaster -Service
                • Starts the Windows service of a JobScheduler Master
              • Start the JobScheduler Master in paused mode:
                • Start-JobSchedulerMaster -Service -Pause
                • The Windows service is started and is immediately paused to prevent any tasks from starting.
              • Restart the JobScheduler Master:
                • Restart-JobSchedulerMaster -Timeout 120
                • Restarts the Master having left any running tasks up to 120 seconds to complete.
              • Stop the JobScheduler Master immediately:
                • Stop-JobSchedulerMaster -Action kill
                • This will kill all running tasks immediately and terminate the JobScheduler Master.
              • Stop the JobScheduler Master cluster:
                • Stop-JobSchedulerMaster -Cluster -Action abort
              • Install the JobScheduler Master Windows service:
                • Install-JobSchedulerService -Start -PauseAfterFailure
                • Installs and starts the Windows service. Should a previous JobScheduler run have been terminated with failure then the JobScheduler Master will switch to paused mode.
                • This allows e.g. to check for enqueued tasks before starting operations.
                • A previously installed Windows service with the same name will be removed.
              • Install the JobScheduler Master Windows service for a specific account:
                • Install-JobSchedulerService -Start -UseCredentials
                • This will install the Windows service and ask for the name of the account and password that the service is operated for. The account name typically includes the domain and user, e.g. .\some_user for some_user in the current domain.
              • Remove the JobScheduler Master Windows service:
                • Remove-JobSchedulerService
                • This will remove the Windows service. Should any tasks be running with the JobScheduler Master then the removal will be delayed. 
                • Consider to use Stop-JobSchedulerMaster -Action abort if immediate removal of the Windows service is required.

              PowerShell CLI in Detail

              Job Management

              Job Chain Management

              Event Management

              Master Managment

              Agent Managment

              Windows Service Management

              Change Management References

              Jira
              serverSOS JIRA
              columnstype,key,issuelinks,fixversions,status,priority,summary,updated
              maximumIssues20
              jqlQuerylabels in (powershell-cli)
              serverId6dc67751-9d67-34cd-985b-194a8cdc9602


              Display children header

              ...