Wait-AdtJobInstance
Synopsis
Waits for adTempus job instances to finish.
Syntax
Default
Wait-AdtJobInstance [-Instance] <ExecutionHistoryItem[]> [-Timeout <timespan>]
[-PollInterval <timespan>] [-ShowMessages]
Description
Waits until the instances are no longer pending or running, then returns them. Status changes are written to the verbose stream, and with -ShowMessages the job log messages are written to the information stream. 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
$instances = Start-AdtJob Nightly\Load; $instances | Wait-AdtJobInstance -Timeout 00:30:00
Parameters
-Instance
The instances to wait for.
| Type | ExecutionHistoryItem[] |
|---|---|
| Required | True |
| Position | 0 |
| Default value | None |
| Accept pipeline input | True (ByValue) |
| Accept wildcard characters | False |
-PollInterval
How often to check the instances. The default is 5 seconds.
| Type | TimeSpan |
|---|---|
| Required | False |
| Position | Named |
| Default value | 00:00:05 |
| Accept pipeline input | False |
| Accept wildcard characters | False |
-ShowMessages
Writes the job log messages to the information stream.
| Type | SwitchParameter |
|---|---|
| Required | False |
| Position | Named |
| Default value | False |
| Accept pipeline input | False |
| Accept wildcard characters | False |
-Timeout
The maximum time to wait. The default is to wait indefinitely.
| Type | TimeSpan |
|---|---|
| Required | False |
| Position | Named |
| Default value | None |
| Accept pipeline input | False |
| Accept wildcard characters | False |
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.ExecutionHistoryItem[]
Job instances from Start-AdtJob or Get-AdtJobInstance.
Outputs
ArcanaDevelopment.adTempus.Client.ExecutionHistoryItem
A job instance (one run of a job).
Notes
The instances keep the connection that fetched them. The connection must still be open.