Get-​Azure​Batch​Subtask

Gets the subtask information of the specified task.

Syntax

Get-AzureBatchSubtask
   [-JobId] <String>
   [-TaskId] <String>
   -BatchContext <BatchAccountContext>
   [-MaxCount <Int32>]
   [<CommonParameters>]
Get-AzureBatchSubtask
   [[-Task] <PSCloudTask>]
   -BatchContext <BatchAccountContext>
   [-MaxCount <Int32>]
   [<CommonParameters>]

Description

The Get-AzureBatchSubtask 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

PS C:\>$Context = Get-AzureRmBatchAccountKeys -AccountName "contosobatchaccount"
PS C:\> Get-AzureBatchSubtask -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-AzureBatchSubtask cmdlet to return all the subtasks for myTask, a task that runs as part of job Job-01.

Required Parameters

-BatchContext

Specifies the BatchAccountContext instance that this cmdlet uses to interact with the Batch service. To obtain a BatchAccountContext object that contains access keys for your subscription, use the Get-AzureRmBatchAccountKeys cmdlet.

Type:BatchAccountContext
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
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
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-TaskId

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

Type:String
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-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
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-AzureBatchTask cmdlet and storing the returned object in a variable.

Type:PSCloudTask
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Outputs

This cmdlet returns instances of the PSSubtaskInformation object.