...
- 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
- The JCLI module will automatically connect to a Master on import of the module if one of the following environment variables is present:
SCHEDULER_URL
specifies the URL for which the Master is operated.SCHEDULER_ID
specifies the unique identification of a Master.SCHEDULER_HOME
specifies the installation path of a locally available Master.
- You can add the command
Import-Module JobScheduler
to your PowerShell profile to have the module loaded on start of a PowerShell session.
- The JCLI module will automatically connect to a Master on import of the module if one of the following environment variables is present:
- Use JobScheduler Master Instance
- As a first operation after importing the module it is required to execute the
Use-Master
cmdlet. PS C:\> Use-Master <Url>
orPS C:\> Use-Master -Url <Url>
- specifies the URL for which the JobScheduler Master is available. This is the same URL that you would use when opening the JOC GUI in your browser, e.g.
http://localhost:4444
. Do not omit the protocol (http/https) for the URL. - 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 to manage a JobScheduler Master running on a Linux box.
- specifying the URL is not sufficient to manage the Windows Service of the respective Master, see below.
- specifies the URL for which the JobScheduler Master is available. This is the same URL that you would use when opening the JOC GUI in your browser, e.g.
PS C:\>
PS C:\> Use-Master -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 name of the JobScheduler ID
- A typical base bath would be
PS C:\> Use-Master -InstallPath <InstallationPath>
- specifies the full installation path, e.g.
C:\Program Files\sos-berlin.com\jobscheduler\scheduler1.10
, for a locally available JobScheduler Master.
- specifies the full installation path, e.g.
PS C:\> Use-Master -InstallPath $env:SCHEDULER_HOME
- You can use 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 ifSCHEDULER_HOME
is present.
- You can use an environment variable
PS C:\> Use-Master <Url> <JobSchedulerID>
- specify both URL and JobScheduler ID (recommended).
- determines if the Master with the specified JobSchedulerID is locally available.
- Hints
- If you JobScheduler Master is configured to require HTTP authentication then please consider that
- by default the Windows credentials of the current user are forwarded
- individual credentials can be added by use of the following command:
Set-Credentials -AskForCredentials
prompts for user input of an account and passwordSet-Credentials -Credentials $credentials
accepts a predefined credentials object that can be created e.g. by$credentials = ( New-Object -typename System.Management.Automation.PSCredential -ArgumentList 'account', ( 'password' | ConvertTo-SecureString -AsPlainText -Force) )
- Technically this allows to store the
account
andpassword
in a script which is not recommended for compliance reasons.
- You can add the command
Set-Credentials
to your PowerShell profile to have the setting applied on start of a PowerShell session.
- If you JobScheduler Master is configured to require HTTP authentication then please consider that
- As a first operation after importing the module it is required to execute the
- Manage JobScheduler Objects
PS C:\> Show-Status
- shows the summary information for a JobScheduler Master
PS C:\> Get-Order
PS C:\> Get-JobChain
PS C:\> Get-Job
PS C:\> Get-Task
- retrieves the list of avaiable objects
- see complete list of cmdlets with the cmdlet:
Get-Command -Module JobScheduler
...