Get-WASJobInstanceStatus

Get-WASJobInstanceStatus

Gets the current status of a job instance.

構文

Parameter Set: Default
Get-WASJobInstanceStatus [-JobInstance] <WASJobInstance[]> [ <CommonParameters>]




詳細説明

The Get-WASJobInstanceStatus cmdlet gets the current status of the specified job instance, including the computers and the tasks running on the computers. The JobInstance parameter is required.

パラメーター

-JobInstance<WASJobInstance[]>

Specifies the job instance that you want to get status for. Use the Get-WASJobInstance cmdlet to get the job instance object to use with this parameter. This is a required parameter.


エイリアス

なし

必須?

true

位置は?

1

既定値

なし

パイプライン入力を許可する

true (ByValue)

ワイルドカード文字を許可する

false

<CommonParameters>

このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (http://go.microsoft.com/fwlink/p/?LinkID=113216)。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

Example 1: Get detailed status of a running job

 

The first command gets the job and saves it as a variable.


PS C:\> $job = Get-WASJob -JobName *Automated*

 

The second command gets the job instances that are running, and saves it as a variable.


PS C:\> $instance = Get-WASJobInstance -Job $job | where {$_.IsComplete -eq $false}

 

The third command displays the status of the job instances.


PS C:\> Get-WASJobInstanceStatus -JobInstance $instance

Example 2: Get a list of computers still running within a specified job instance

 

The first command gets the job and saves it as a variable.


PS C:\> $job = Get-WASJob -JobName *Automated*

 

The second command gets the job instances that are running, and saves it as a variable.


PS C:\> $instance = Get-WASJobInstance -Job $job | where {$_.IsComplete -eq $false}

 

The third command gets the computers that are running for that job instance.


PS C:\> $runningComps = foreach ($status in Get-WASJobInstanceStatus -JobInstance $instance) { foreach ($comp in $status.computers) { if ($comp.Status -eq "Running") { $comp.Computer} }}

 

The fourth command formats the output data as a table.


PS C:\> format-table -property ComputerName,Location,RebootRequired -inputobject $runningComps

関連トピック

コミュニティの追加

追加
表示: