Stop-AdtJobInstance
Synopsis
Stops (terminates) running adTempus job instances.
Syntax
Instance (Default)
Stop-AdtJobInstance [-Instance] <ExecutionHistoryItem[]> [-Reason <string>] [-Wait] [-Acknowledge]
[-Timeout <timespan>] [-Force] [-Connection <AdtConnection>] [-Server <string>]
[-Credential <pscredential>] [-WhatIf] [-Confirm]
Job
Stop-AdtJobInstance -Job <Job[]> [-InstanceId <int>] [-Reason <string>] [-Wait] [-Acknowledge]
[-Timeout <timespan>] [-Force] [-Connection <AdtConnection>] [-Server <string>]
[-Credential <pscredential>] [-WhatIf] [-Confirm]
Description
Terminates instances piped from Get-AdtJobInstance or Start-AdtJob, or all running instances of the specified jobs. With -Wait, waits until the instances have ended and returns them.
Examples
Example 1
Get-AdtJob Load* | Get-AdtJobInstance -Active | Stop-AdtJobInstance -Reason 'Maintenance' -Wait
Example 2
Stop-AdtJobInstance -Job (Get-AdtJob Nightly\Load) -Wait -Acknowledge
Terminates all running instances of a job, waits for them to end, and acknowledges their status.
Parameters
-Acknowledge
With -Wait, acknowledges the status of the instances after they end.
| Type | SwitchParameter |
|---|---|
| Required | False |
| Position | Named |
| Default value | False |
| 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 |
-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 |
-Force
Terminates without prompting for confirmation.
| Type | SwitchParameter |
|---|---|
| Required | False |
| Position | Named |
| Default value | False |
| Accept pipeline input | False |
| Accept wildcard characters | False |
-Instance
The instances to terminate.
| Type | ExecutionHistoryItem[] |
|---|---|
| Parameter sets | Instance |
| Required | True |
| Position | 0 |
| Default value | None |
| Accept pipeline input | True (ByValue) |
| Accept wildcard characters | False |
-InstanceId
With -Job, the instance number to terminate. By default all running instances are terminated.
| Type | Int32 |
|---|---|
| Parameter sets | Job |
| Required | False |
| Position | Named |
| Default value | 0 |
| Accept pipeline input | False |
| Accept wildcard characters | False |
-Job
The jobs whose instances are terminated.
| Type | Job[] |
|---|---|
| Parameter sets | Job |
| Required | True |
| Position | Named |
| Default value | None |
| Accept pipeline input | False |
| Accept wildcard characters | False |
-Reason
The reason for the termination, recorded in the job history.
| Type | String |
|---|---|
| Required | False |
| Position | Named |
| Default value | None |
| Accept pipeline input | False |
| Accept wildcard characters | False |
-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 |
-Timeout
The maximum time to wait, with -Wait.
| Type | TimeSpan |
|---|---|
| Required | False |
| Position | Named |
| Default value | None |
| Accept pipeline input | False |
| Accept wildcard characters | False |
-Wait
Waits for the instances to end.
| 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.ExecutionHistoryItem[]
Job instances from Start-AdtJob or Get-AdtJobInstance.
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.