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>

이 cmdlet은 일반 매개 변수 -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer 및 -OutVariable을 지원합니다. 자세한 내용은 다음을 참조하세요. about_CommonParameters(https://go.microsoft.com/fwlink/p/?LinkID=113216).

입력

입력 유형은 cmdlet에 파이프할 수 있는 개체의 유형입니다.

출력

출력 유형은 cmdlet이 내보내는 개체의 유형입니다.

예제

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

관련 항목

Get-WASJob

Get-WASJobInstance

Windows Assessment Services Technical Reference