Get-AzBatchTaskSlotCount
取得指定作業的工作位置計數。
語法
Get-AzBatchTaskSlotCount
[-JobId] <String>
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzBatchTaskSlotCount
[[-Job] <PSCloudJob>]
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
Get-AzBatchTaskSlotCount Cmdlet 會取得 Batch 作業的 Azure Batch 工作位置計數。 藉由 JobId 參數或 Job 參數來指定作業。 工作位置計數會依作用中、執行或已完成的工作狀態,以及工作成功或失敗的位置計數,提供位置計數。 準備狀態中工作的位置會計算為執行中。 如果 validationStatus 未經驗證,則 Batch 服務無法根據清單工作 API 中所報告的工作狀態檢查狀態計數。 如果作業包含超過 200,000 個工作,則 validationStatus 可能會未經驗證。
範例
範例 1:依標識符取得工作計數
Get-AzBatchTaskSlotCount -JobId "Job01" -BatchContext $Context
Active : 1
Completed : 0
Failed : 0
Running : 1
Succeeded : 5
ValidationStatus : Validated
此命令會取得作業 Job01 的工作計數。 使用 Get-AzBatchAccountKey Cmdlet 將內容指派給$Context變數。
參數
-BatchContext
與 Batch 服務互動時要使用的 BatchAccountContext 實例。 如果您使用 Get-AzBatchAccount Cmdlet 來取得 BatchAccountContext,則與 Batch 服務互動時,將會使用Microsoft Entra 驗證。 若要改用共用密鑰驗證,請使用 Get-AzBatchAccountKeys Cmdlet 來取得已填入其存取金鑰的 BatchAccountContext 物件。 使用共用金鑰驗證時,預設會使用主要存取金鑰。 若要變更要使用的密鑰,請設定 BatchAccountContext.KeyInUse 屬性。
類型: | BatchAccountContext |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-DefaultProfile
用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。
類型: | IAzureContextContainer |
別名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-Job
指定工作,其中包含此 Cmdlet 取得的工作。 若要取得 PSCloudJob 物件,請使用 Get-AzBatchJob Cmdlet。
類型: | PSCloudJob |
Position: | 0 |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-JobId
要為其取得工作位置計數之作業的標識碼。
類型: | String |
Position: | 0 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |