Start-AdtJob
Synopsis
Runs adTempus jobs.
Syntax
Job (Default)
Start-AdtJob [-Job] <Job[]> [-Variable <hashtable>] [-Step <string>] [-Checkpoint <string>]
[-Comment <string>] [-IgnoreJobConditions] [-IgnoreStepConditions] [-NoForce] [-ForceController]
[-ControllerOnly] [-Agent <string[]>] [-Responses <ExecutionResponseBehavior>] [-NoCycleId] [-Wait]
[-Timeout <timespan>] [-PollInterval <timespan>] [-ShowMessages] [-Connection <AdtConnection>]
[-Server <string>] [-Credential <pscredential>] [-WhatIf] [-Confirm]
Name
Start-AdtJob [-Name] <string[]> [-Variable <hashtable>] [-Step <string>] [-Checkpoint <string>]
[-Comment <string>] [-IgnoreJobConditions] [-IgnoreStepConditions] [-NoForce] [-ForceController]
[-ControllerOnly] [-Agent <string[]>] [-Responses <ExecutionResponseBehavior>] [-NoCycleId] [-Wait]
[-Timeout <timespan>] [-PollInterval <timespan>] [-ShowMessages] [-Connection <AdtConnection>]
[-Server <string>] [-Credential <pscredential>] [-WhatIf] [-Confirm]
Id
Start-AdtJob -Id <guid[]> [-Variable <hashtable>] [-Step <string>] [-Checkpoint <string>]
[-Comment <string>] [-IgnoreJobConditions] [-IgnoreStepConditions] [-NoForce] [-ForceController]
[-ControllerOnly] [-Agent <string[]>] [-Responses <ExecutionResponseBehavior>] [-NoCycleId] [-Wait]
[-Timeout <timespan>] [-PollInterval <timespan>] [-ShowMessages] [-Connection <AdtConnection>]
[-Server <string>] [-Credential <pscredential>] [-WhatIf] [-Confirm]
Description
Submits jobs for execution and returns the instances that were started. Jobs can be piped from Get-AdtJob or specified by name or ID. A name must identify a single job; if more than one job matches, an error lists the matching jobs.
Use -Wait to wait for the instances to finish. When waiting, an error with ID JobFailed is written for each instance that finishes with a failure status, and an error with ID WaitTimeout is written if the -Timeout elapses.
Examples
Example 1
Get-AdtJob 'Nightly\*' | Start-AdtJob -Variable @{Source='PS'} -Wait -Timeout 01:00:00
Runs all jobs in the Nightly group with a job variable, and waits up to an hour for them to finish.
Example 2
Start-AdtJob 'Finance\Load' -Step 2-4 -Wait -ShowMessages
Runs steps 2 through 4 of a job and displays its log messages while waiting.
Parameters
-Agent
The names of the Agents to run the job on.
| Type | String[] |
|---|---|
| Required | False |
| Position | Named |
| Default value | None |
| Accept pipeline input | False |
| Accept wildcard characters | True |
-Checkpoint
The checkpoint value passed to the job.
| Type | String |
|---|---|
| Required | False |
| Position | Named |
| Default value | None |
| Accept pipeline input | False |
| Accept wildcard characters | False |
-Comment
Comments recorded in the job history.
| Type | String |
|---|---|
| Required | False |
| Position | Named |
| Default value | None |
| Accept pipeline input | False |
| Accept wildcard characters | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
| Type | SwitchParameter |
|---|---|
| Required | False |
| Position | Named |
| Default value | False |
| Accept pipeline input | False |
| Accept wildcard characters | False |
| Aliases | cf |
-Connection
The connection to use. See Connect-AdtServer.
| Type | AdtConnection |
|---|---|
| Required | False |
| Position | Named |
| Default value | None |
| Accept pipeline input | False |
| Accept wildcard characters | False |
-ControllerOnly
Runs the job on the Controller only, never on Agents.
| Type | SwitchParameter |
|---|---|
| Required | False |
| Position | Named |
| Default value | False |
| Accept pipeline input | False |
| Accept wildcard characters | False |
-Credential
The credential used to connect to the -Server.
| Type | PSCredential |
|---|---|
| Required | False |
| Position | Named |
| Default value | None |
| Accept pipeline input | False |
| Accept wildcard characters | False |
-ForceController
Runs the job on the Controller, even if it is configured to run on Agents.
| Type | SwitchParameter |
|---|---|
| Required | False |
| Position | Named |
| Default value | False |
| Accept pipeline input | False |
| Accept wildcard characters | False |
-Id
The IDs of the jobs to run.
| Type | Guid[] |
|---|---|
| Parameter sets | Id |
| Required | True |
| Position | Named |
| Default value | None |
| Accept pipeline input | False |
| Accept wildcard characters | False |
-IgnoreJobConditions
Determines whether job-level conditions are ignored. The default is $true; specify -IgnoreJobConditions:$false to evaluate them.
| Type | SwitchParameter |
|---|---|
| Required | False |
| Position | Named |
| Default value | True |
| Accept pipeline input | False |
| Accept wildcard characters | False |
-IgnoreStepConditions
Ignores step-level conditions.
| Type | SwitchParameter |
|---|---|
| Required | False |
| Position | Named |
| Default value | False |
| Accept pipeline input | False |
| Accept wildcard characters | False |
-Job
The jobs to run.
| Type | Job[] |
|---|---|
| Parameter sets | Job |
| Required | True |
| Position | 0 |
| Default value | None |
| Accept pipeline input | True (ByValue) |
| Accept wildcard characters | False |
-Name
The names of the jobs to run. See Get-AdtJob for the name format.
| Type | String[] |
|---|---|
| Parameter sets | Name |
| Required | True |
| Position | 0 |
| Default value | None |
| Accept pipeline input | False |
| Accept wildcard characters | False |
-NoCycleId
Does not update the job's cycle ID.
| Type | SwitchParameter |
|---|---|
| Required | False |
| Position | Named |
| Default value | False |
| Accept pipeline input | False |
| Accept wildcard characters | False |
-NoForce
Does not start a new instance if the job is already running. By default a new instance is always started.
| Type | SwitchParameter |
|---|---|
| Required | False |
| Position | Named |
| Default value | False |
| Accept pipeline input | False |
| Accept wildcard characters | False |
-PollInterval
How often to check the instances while waiting. The default is 5 seconds.
| Type | TimeSpan |
|---|---|
| Required | False |
| Position | Named |
| Default value | 00:00:05 |
| Accept pipeline input | False |
| Accept wildcard characters | False |
-Responses
Which responses are executed: All (the default), None, or NoJobControl.
| Type | ExecutionResponseBehavior |
|---|---|
| Required | False |
| Position | Named |
| Default value | All |
| Accept pipeline input | False |
| Accept wildcard characters | False |
| Accepted values | All, None, NoJobControl |
-Server
The server to connect to, if no connection is specified.
| Type | String |
|---|---|
| Required | False |
| Position | Named |
| Default value | None |
| Accept pipeline input | False |
| Accept wildcard characters | False |
-ShowMessages
Writes the job's log messages to the information stream while waiting.
| Type | SwitchParameter |
|---|---|
| Required | False |
| Position | Named |
| Default value | False |
| Accept pipeline input | False |
| Accept wildcard characters | False |
-Step
The steps to run, such as "2-4", "3-" (step 3 to the end), "-3" (steps 1 to 3), or "1,3,5".
| Type | String |
|---|---|
| Required | False |
| Position | Named |
| Default value | None |
| Accept pipeline input | False |
| Accept wildcard characters | False |
-Timeout
The maximum time to wait, with -Wait. The default is to wait indefinitely.
| Type | TimeSpan |
|---|---|
| Required | False |
| Position | Named |
| Default value | None |
| Accept pipeline input | False |
| Accept wildcard characters | False |
-Variable
Job variables to set for the run, as a hashtable of names and values.
| Type | Hashtable |
|---|---|
| Required | False |
| Position | Named |
| Default value | None |
| Accept pipeline input | False |
| Accept wildcard characters | False |
-Wait
Waits for the instances to finish.
| Type | SwitchParameter |
|---|---|
| Required | False |
| Position | Named |
| Default value | False |
| Accept pipeline input | False |
| Accept wildcard characters | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
| Type | SwitchParameter |
|---|---|
| Required | False |
| Position | Named |
| Default value | False |
| Accept pipeline input | False |
| Accept wildcard characters | False |
| Aliases | wi |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
ArcanaDevelopment.adTempus.Client.Job[]
Jobs from Get-AdtJob.
Outputs
ArcanaDevelopment.adTempus.Client.ExecutionHistoryItem
A job instance (one run of a job).
Notes
This cmdlet uses the connection that fetched the objects piped to it. Otherwise it uses the connection given by -Connection, or a connection to -Server (reused if one is already open for the same server and user), or the default connection. If no connection is open, it connects to the local server using Windows authentication. See Connect-AdtServer.