Get-ServiceFabricNodeTransitionProgress

取得節點轉換作業的進度。

Syntax

Get-ServiceFabricNodeTransitionProgress
   -OperationId <Guid>
   [-TimeoutSec <Int32>]
   [<CommonParameters>]

Description

節點轉換作業是啟動或停止 Service Fabric 節點的作業。 Get-ServiceFabricNodeTransitionProgress Cmdlet 會取得使用Start-ServiceFabricNodeTransition Cmdlet 啟動的節點轉換作業進度。 此 Cmdlet 會傳回 System.Fabric.NodeTransitionProgress類型的物件。 該物件的 State 屬性工作表示作業的目前狀態。 例如,狀態值 Running 表示作業正在進行中。 Completed 表示它已成功完成。

如需詳細資訊,請參閱 以節點轉換 API 取代啟動節點和停止節點 API

範例

範例 1:檢查作業的進度

PS C:\> $CurrentProgress = Get-ServiceFabricNodeTransitionProgress -OperationId c645433e-a68f-4c8a-8cfb-076d339726a8

PS C:\> $CurrentProgress.State

Running

在上述範例中,查詢作業的進度,結果表示作業處於 執行中狀態

範例 2:針對失敗的作業進行疑難排解

PS C:\> $CurrentProgress = Get-ServiceFabricNodeTransitionProgress -OperationId 6f2bedbe-72c7-4d25-891d-4e070e8809a0

PS C:\> $CurrentProgress.State

Faulted

PS C:\> $CurrentProgress.Result.Exception.ErrorCode

InstanceIdMismatch

在上述範例中,會查詢作業的進度。 結果表示作業處於 Faulted 狀態, 且 Result.Exception.ErrorCode 值為 InstanceIdMismatch。 這表示已提供不正確的 NodeInstanceId 。 請注意,在作業到達終端狀態之前, Result 物件會$Null。

參數

-OperationId

指定用來追蹤作業的唯一識別碼。 這是您用來使用 Start-ServiceFabricNodeTransition啟動作業的相同值。

Type:Guid
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-TimeoutSec

指定此 Cmdlet 的逾時值,以秒為單位。

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

輸入

None

輸出

System.Object