Edit

Share via


Get-AzBatchSubtask

Gets the subtask information of the specified task.

Syntax

ODataFilter (Default)

Get-AzBatchSubtask
    [-JobId] <String>
    [-TaskId] <String>
    -BatchContext <BatchAccountContext>
    [-MaxCount <Int32>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

ParentObject

Get-AzBatchSubtask
    [[-Task] <PSCloudTask>]
    -BatchContext <BatchAccountContext>
    [-MaxCount <Int32>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

Description

The Get-AzBatchSubtask cmdlet retrieves the subtask information about the specified task. Subtasks provide parallel processing for individual tasks, and enable precise monitoring of task execution and progress.

Examples

Example 1: Return all subtasks for a specified task

$Context = Get-AzBatchAccountKey -AccountName "contosobatchaccount"
Get-AzBatchSubtask -JobId "Job-01" -TaskID "myTask" -BatchContext $Context

These commands return all the subtasks for the task with the ID myTask. To do this, the first command in the example creates an object reference to the account keys for the batch account contosobatchaccount. This object reference is stored in a variable named $context. The second command then uses that object reference and the Get-AzBatchSubtask cmdlet to return all the subtasks for myTask, a task that runs as part of job Job-01.

Parameters

-BatchContext

Specifies the BatchAccountContext instance that this cmdlet uses to interact 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-AzBatchAccountKey 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

-JobId

Specifies the ID of the job that contains the task whose subtasks this cmdlet gets.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ODataFilter
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-MaxCount

Specifies the maximum number of subtasks to return. If you specify a value of zero (0) or less, the cmdlet does not use an upper limit. The default value is 1000.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Task

Specifies an object reference to the task that contain the subtasks that this cmdlet returns. This object reference is created by using the Get-AzBatchTask cmdlet and storing the returned object in a variable.

Parameter properties

Type:PSCloudTask
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

-TaskId

Specifies the ID of the task whose subtasks this cmdlet returns.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ODataFilter
Position:1
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.

Inputs

String

PSCloudTask

BatchAccountContext

Outputs

PSSubtaskInformation