Editar

Partilhar via


Get-AzBatchSubtask

Gets the subtask information of the specified task.

Syntax

Get-AzBatchSubtask
   [-JobId] <String>
   [-TaskId] <String>
   [-MaxCount <Int32>]
   -BatchContext <BatchAccountContext>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzBatchSubtask
   [[-Task] <PSCloudTask>]
   [-MaxCount <Int32>]
   -BatchContext <BatchAccountContext>
   [-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.

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

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-JobId

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

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters: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.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters: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.

Type:PSCloudTask
Position:0
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-TaskId

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

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Inputs

String

PSCloudTask

BatchAccountContext

Outputs

PSSubtaskInformation