Get-AzBatchTaskSlotCount
Gets the task slot counts for the specified job.
Syntax
Id (Default)
Get-AzBatchTaskSlotCount
[-JobId] <String>
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
ParentObject
Get-AzBatchTaskSlotCount
[[-Job] <PSCloudJob>]
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
The Get-AzBatchTaskSlotCount cmdlet gets the Azure Batch task slot counts for a Batch job. Specify a job by either the JobId parameter or the Job parameter. Task slot counts provide a count of slots by active, running or completed task state, and a count of slots on which tasks succeeded or failed. Slots for tasks in the preparing state are counted as running. If the validationStatus is unvalidated, then the Batch service has not been able to check state counts against the task states as reported in the List Tasks API. The validationStatus may be unvalidated if the job contains more than 200,000 tasks.
Examples
Example 1: Get task counts by ID
Get-AzBatchTaskSlotCount -JobId "Job01" -BatchContext $Context
Active : 1
Completed : 0
Failed : 0
Running : 1
Succeeded : 5
ValidationStatus : Validated
This command gets the task counts for job Job01. Use the Get-AzBatchAccountKey cmdlet to assign a context to the $Context variable.
Parameters
-BatchContext
The BatchAccountContext instance to use when interacting with the Batch service. If you use the Get-AzBatchAccount cmdlet to get your BatchAccountContext, then Microsoft Entra authentication will be used when interacting with the Batch service. To use shared key authentication instead, use the Get-AzBatchAccountKeys cmdlet to get a BatchAccountContext object with its access keys populated. When using shared key authentication, the primary access key is used by default. To change the key to use, set the BatchAccountContext.KeyInUse property.
Parameter properties
Type: | BatchAccountContext |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
Parameter properties
Type: | IAzureContextContainer |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Job
Specifies the job that contains tasks that this cmdlet gets. To obtain a PSCloudJob object, use the Get-AzBatchJob cmdlet.
Parameter properties
Type: | PSCloudJob |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
ParentObject
Position: | 0 |
Mandatory: | False |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-JobId
The id of the job for which to get task slot counts.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
Id
Position: | 0 |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
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.