Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Get-AzureBatchTask

Get-AzureBatchTask

microsoft.azure.commands.batch.dll

Synopsis

Gets the Azure Batch tasks under the specified job.

Syntax

Get-AzureBatchTask [-WorkItemName] [-JobName] [-BatchContext] [-Filter] [-MaxCount] [<CommonParameters>]

Get-AzureBatchTask [-WorkItemName] [-JobName] [-Name] [-BatchContext] [<CommonParameters>]

Get-AzureBatchTask [-Job] [-BatchContext] [-Filter] [-MaxCount] [<CommonParameters>]

Detailed Description

Gets the Azure Batch tasks under the job specified by either the WorkItemName and JobName parameters or the Job parameter. You can use the Name parameter to get a single task, or you can use the Filter parameter to get the tasks that match an OData filter.

Parameters

-BatchContext <BatchAccountContext>

The BatchAccountContext instance to use when interacting with the Batch service. Use the Get-AzureBatchAccountKeys cmdlet to get a BatchAccountContext object with its access keys populated.

Aliases

None

Required?

true

Position

named

Default value

None

Accept pipeline input?

true (ByValue)

Accept wildcard characters?

false

-Filter <string>

The OData filter clause to use when querying for tasks. If no filter is specified, then all tasks under the job specified with either the WorkItemName and JobName parameters or the Job parameter will be returned.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-Job <PSCloudJob>

The PSCloudJob object representing the job which contains the tasks. Use the Get-AzureBatchJob cmdlet to get a PSCloudJob object.

Aliases

None

Required?

false

Position

1

Default value

None

Accept pipeline input?

true (ByValue)

Accept wildcard characters?

false

-JobName <string>

The name of the job which contains the tasks.

Aliases

None

Required?

true

Position

2

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-MaxCount <int>

The maximum number of tasks to return. If a value of 0 or less is specified, then no upper limit will be used. If no value is specified, a default value of 1000 will be used.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-Name <string>

The name of the task to retrieve. Wildcards are not permitted.

Aliases

None

Required?

false

Position

3

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-WorkItemName <string>

The name of the workitem which contains the tasks.

Aliases

None

Required?

true

Position

1

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

Input Type


Return Type

PSCloudTask

Notes

Examples

-------------------------- EXAMPLE 1 --------------------------

C:\PS>

Description

-----------

Gets the task named "myTask" under job "job-0000000001" under workitem "myWorkItem".

        Get-AzureBatchTask -WorkItemName "myWorkItem" -JobName "job-0000000001" -Name "myTask" -BatchContext $context

        AffinityInformation         :
        CommandLine                 : cmd /c dir /s
        CreationTime                : 3/24/2015 10:21:51 PM
        EnvironmentSettings         :
        ExecutionInformation        : Microsoft.Azure.Commands.Batch.Models.PSTaskExecutionInformation
        LastModified                : 3/24/2015 10:21:51 PM
        Name                        : myTask
        PreviousState               : Running
        PreviousStateTransitionTime : 3/24/2015 10:22:00 PM
        RunElevated                 : False
        State                       : Completed
        StateTransitionTime         : 3/24/2015 10:22:00 PM
        Statistics                  :
        TaskConstraints             : Microsoft.Azure.Commands.Batch.Models.PSTaskConstraints
        Url                         : https://cmdletexample.batch-test.windows-int.net/workitems/myWorkItem/jobs/job-0000000001/tasks/myTask
        VMInformation               : Microsoft.Azure.Commands.Batch.Models.PSVMInformation
        ResourceFiles               :
      

-------------------------- EXAMPLE 2 --------------------------

C:\PS>

Description

-----------

Gets the completed tasks under the job named "job-0000000001" under workitem "myWorkItem".

        Get-AzureBatchTask -WorkItemName "myWorkItem" -JobName "job-0000000001" -Filter "state eq 'completed'" -BatchContext $context

        AffinityInformation         :
        CommandLine                 : cmd /c dir /s
        CreationTime                : 3/24/2015 10:21:51 PM
        EnvironmentSettings         :
        ExecutionInformation        : Microsoft.Azure.Commands.Batch.Models.PSTaskExecutionInformation
        LastModified                : 3/24/2015 10:21:51 PM
        Name                        : myTask
        PreviousState               : Running
        PreviousStateTransitionTime : 3/24/2015 10:22:00 PM
        RunElevated                 : False
        State                       : Completed
        StateTransitionTime         : 3/24/2015 10:22:00 PM
        Statistics                  :
        TaskConstraints             : Microsoft.Azure.Commands.Batch.Models.PSTaskConstraints
        Url                         : https://cmdletexample.batch-test.windows-int.net/workitems/myWorkItem/jobs/job-0000000001/tasks/myTask
        VMInformation               : Microsoft.Azure.Commands.Batch.Models.PSVMInformation
        ResourceFiles               :

        AffinityInformation         :
        CommandLine                 : cmd /c echo hello > newFile.txt
        CreationTime                : 3/24/2015 10:23:35 PM
        EnvironmentSettings         :
        ExecutionInformation        : Microsoft.Azure.Commands.Batch.Models.PSTaskExecutionInformation
        LastModified                : 3/24/2015 10:23:35 PM
        Name                        : myTask2
        PreviousState               : Running
        PreviousStateTransitionTime : 3/24/2015 10:23:37 PM
        RunElevated                 : True
        State                       : Completed
        StateTransitionTime         : 3/24/2015 10:23:37 PM
        Statistics                  :
        TaskConstraints             : Microsoft.Azure.Commands.Batch.Models.PSTaskConstraints
        Url                         : https://cmdletexample.batch-test.windows-int.net/workitems/myWorkItem/jobs/job-0000000001/tasks/myTask2
        VMInformation               : Microsoft.Azure.Commands.Batch.Models.PSVMInformation
        ResourceFiles               :

      

-------------------------- EXAMPLE 3 --------------------------

C:\PS>

Description

-----------

Gets all tasks under the job named "job-0000000001" under workitem "myWorkItem".

        Get-AzureBatchJob -WorkItemName "myWorkItem" -Name "job-0000000001" -BatchContext $context | Get-AzureBatchTask -BatchContext $context

        AffinityInformation         :
        CommandLine                 : cmd /c dir /s
        CreationTime                : 3/24/2015 10:21:51 PM
        EnvironmentSettings         :
        ExecutionInformation        : Microsoft.Azure.Commands.Batch.Models.PSTaskExecutionInformation
        LastModified                : 3/24/2015 10:21:51 PM
        Name                        : myTask
        PreviousState               : Running
        PreviousStateTransitionTime : 3/24/2015 10:22:00 PM
        RunElevated                 : False
        State                       : Completed
        StateTransitionTime         : 3/24/2015 10:22:00 PM
        Statistics                  :
        TaskConstraints             : Microsoft.Azure.Commands.Batch.Models.PSTaskConstraints
        Url                         : https://cmdletexample.batch-test.windows-int.net/workitems/myWorkItem/jobs/job-0000000001/tasks/myTask
        VMInformation               : Microsoft.Azure.Commands.Batch.Models.PSVMInformation
        ResourceFiles               :

        AffinityInformation         :
        CommandLine                 : cmd /c echo hello > newFile.txt
        CreationTime                : 3/24/2015 10:23:35 PM
        EnvironmentSettings         :
        ExecutionInformation        : Microsoft.Azure.Commands.Batch.Models.PSTaskExecutionInformation
        LastModified                : 3/24/2015 10:23:35 PM
        Name                        : myTask2
        PreviousState               : Running
        PreviousStateTransitionTime : 3/24/2015 10:23:37 PM
        RunElevated                 : True
        State                       : Completed
        StateTransitionTime         : 3/24/2015 10:23:37 PM
        Statistics                  :
        TaskConstraints             : Microsoft.Azure.Commands.Batch.Models.PSTaskConstraints
        Url                         : https://cmdletexample.batch-test.windows-int.net/workitems/myWorkItem/jobs/job-0000000001/tasks/myTask2
        VMInformation               : Microsoft.Azure.Commands.Batch.Models.PSVMInformation
        ResourceFiles               :