Table of Contents

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.

TypeExecutionHistoryItem[]
RequiredTrue
Position0
Default valueNone
Accept pipeline inputTrue (ByValue)
Accept wildcard charactersFalse

-PollInterval

How often to check the instances. The default is 5 seconds.

TypeTimeSpan
RequiredFalse
PositionNamed
Default value00:00:05
Accept pipeline inputFalse
Accept wildcard charactersFalse

-ShowMessages

Writes the job log messages to the information stream.

TypeSwitchParameter
RequiredFalse
PositionNamed
Default valueFalse
Accept pipeline inputFalse
Accept wildcard charactersFalse

-Timeout

The maximum time to wait. The default is to wait indefinitely.

TypeTimeSpan
RequiredFalse
PositionNamed
Default valueNone
Accept pipeline inputFalse
Accept wildcard charactersFalse

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.