Delen via


Get-AzBatchTask

Haalt de Batch-taken voor een taak op.

Syntax

Get-AzBatchTask
   [-JobId] <String>
   [-Filter <String>]
   [-MaxCount <Int32>]
   [-Select <String>]
   [-Expand <String>]
   -BatchContext <BatchAccountContext>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzBatchTask
   [-JobId] <String>
   [[-Id] <String>]
   [-Select <String>]
   [-Expand <String>]
   -BatchContext <BatchAccountContext>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzBatchTask
   [[-Job] <PSCloudJob>]
   [-Filter <String>]
   [-MaxCount <Int32>]
   [-Select <String>]
   [-Expand <String>]
   -BatchContext <BatchAccountContext>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

De cmdlet Get-AzBatchTask haalt Azure Batch-taken op voor een Batch-taak. Geef een taak op met de parameter JobId of de parameter Job . Als u één taak wilt ophalen, geeft u de id-parameter op. U kunt de filterparameter opgeven om de taken op te halen die overeenkomen met een OData-filter (Open Data Protocol).

Voorbeelden

Voorbeeld 1: Een taak ophalen op id

Get-AzBatchTask -JobId "Job01" -Id "Task03" -BatchContext $Context

AffinityInformation         :
CommandLine                 : cmd /c dir /s
ComputeNodeInformation      : Microsoft.Azure.Commands.Batch.Models.PSComputeNodeInformation
Constraints                 : Microsoft.Azure.Commands.Batch.Models.PSTaskConstraints
CreationTime                : 7/25/2015 11:24:52 PM
DisplayName                 :
EnvironmentSettings         :
ETag                        : 0x8D295483E08BD9D
ExecutionInformation        : Microsoft.Azure.Commands.Batch.Models.PSTaskExecutionInformation
Id                          : Task03
LastModified                : 7/25/2015 11:24:52 PM
PreviousState               : Running
PreviousStateTransitionTime : 7/25/2015 11:24:59 PM
ResourceFiles               :
RunElevated                 : False
State                       : Completed
StateTransitionTime         : 7/25/2015 11:24:59 PM
Statistics                  :
Url                         : https://pfuller.westus.batch.azure.com/jobs/Job01/tasks/Task03

Met deze opdracht wordt de taak met id Task03 onder job Job01 ophaalt. Gebruik de cmdlet Get-AzBatchAccountKey om een context toe te wijzen aan de variabele $Context.

Voorbeeld 2: Alle voltooide taken ophalen uit een opgegeven taak

Get-AzBatchTask -JobId "Job02" -Filter "state eq 'completed'" -BatchContext $Context

AffinityInformation         :
CommandLine                 : cmd /c dir /s
ComputeNodeInformation      : Microsoft.Azure.Commands.Batch.Models.PSComputeNodeInformation
Constraints                 : Microsoft.Azure.Commands.Batch.Models.PSTaskConstraints
CreationTime                : 3/24/2015 10:21:51 PM
EnvironmentSettings         :
ETag                        : 0x8D295483E08BD9D
ExecutionInformation        : Microsoft.Azure.Commands.Batch.Models.PSTaskExecutionInformation
Id                          : Task17
LastModified                : 3/24/2015 10:21:51 PM
PreviousState               : Running
PreviousStateTransitionTime : 3/24/2015 10:22:00 PM
ResourceFiles               :
RunElevated                 : False
State                       : Completed
StateTransitionTime         : 3/24/2015 10:22:00 PM
Statistics                  :
Url                         : https://pfuller.westus.batch.azure.com/jobs/Job02/tasks/Task17

AffinityInformation         :
CommandLine                 : cmd /c echo hello > newFile.txt
ComputeNodeInformation      : Microsoft.Azure.Commands.Batch.Models.PSComputeNodeInformation
Constraints                 : Microsoft.Azure.Commands.Batch.Models.PSTaskConstraints
CreationTime                : 3/24/2015 10:21:51 PM
EnvironmentSettings         :
ETag                        : 0x8D295483E08BD9D
ExecutionInformation        : Microsoft.Azure.Commands.Batch.Models.PSTaskExecutionInformation
Id                          : Task27
LastModified                : 3/24/2015 10:23:35 PM
PreviousState               : Running
PreviousStateTransitionTime : 3/24/2015 10:23:37 PM
ResourceFiles               :
RunElevated                 : True
State                       : Completed
StateTransitionTime         : 3/24/2015 10:23:37 PM
Statistics                  :
Url                         : https://pfuller.westus.batch.azure.com/jobs/Job02/tasks/Task27

Met deze opdracht worden de voltooide taken opgehaald uit de taak met de id Job02.

Parameters

-BatchContext

Hiermee geeft u het BatchAccountContext-exemplaar op dat door deze cmdlet wordt gebruikt om te communiceren met de Batch-service. Als u de Cmdlet Get-AzBatchAccount gebruikt om uw BatchAccountContext op te halen, wordt Microsoft Entra-verificatie gebruikt bij interactie met de Batch-service. Als u in plaats daarvan gedeelde sleutelverificatie wilt gebruiken, gebruikt u de cmdlet Get-AzBatchAccountKey om een BatchAccountContext-object op te halen waarin de bijbehorende toegangssleutels zijn ingevuld. Wanneer u verificatie met gedeelde sleutels gebruikt, wordt de primaire toegangssleutel standaard gebruikt. Als u de sleutel wilt wijzigen die u wilt gebruiken, stelt u de eigenschap BatchAccountContext.KeyInUse in.

Type:BatchAccountContext
Position:Named
standaardwaarde:None
Vereist:True
Accept pipeline input:True
Accept wildcard characters:False

-DefaultProfile

De referenties, het account, de tenant en het abonnement die worden gebruikt voor communicatie met Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
standaardwaarde:None
Vereist:False
Accept pipeline input:False
Accept wildcard characters:False

-Expand

Hiermee geeft u een OData-uitbreidingscomponent op. Geef een waarde op voor deze parameter om gekoppelde entiteiten van de hoofdentiteit op te halen.

Type:String
Position:Named
standaardwaarde:None
Vereist:False
Accept pipeline input:False
Accept wildcard characters:False

-Filter

Hiermee geeft u een OData-filtercomponent voor taken op. Als u geen filter opgeeft, retourneert deze cmdlet alle taken voor het Batch-account of de Batch-taak.

Type:String
Position:Named
standaardwaarde:None
Vereist:False
Accept pipeline input:False
Accept wildcard characters:False

-Id

Hiermee geeft u de id op van de taak die door deze cmdlet wordt ophaalt. U kunt geen jokertekens opgeven.

Type:String
Position:1
standaardwaarde:None
Vereist:False
Accept pipeline input:False
Accept wildcard characters:False

-Job

Hiermee geeft u de taak op die taken bevat die door deze cmdlet worden opgeslagen. Gebruik de cmdlet Get-AzBatchJob om een PSCloudJob-object op te halen.

Type:PSCloudJob
Position:0
standaardwaarde:None
Vereist:False
Accept pipeline input:True
Accept wildcard characters:False

-JobId

Hiermee geeft u de id op van de taak die de taken bevat die deze cmdlet ophaalt.

Type:String
Position:0
standaardwaarde:None
Vereist:True
Accept pipeline input:True
Accept wildcard characters:False

-MaxCount

Hiermee geeft u het maximum aantal taken dat moet worden geretourneerd. Als u een waarde van nul (0) of minder opgeeft, gebruikt de cmdlet geen bovengrens. De standaardwaarde is 1000.

Type:Int32
Position:Named
standaardwaarde:None
Vereist:False
Accept pipeline input:False
Accept wildcard characters:False

-Select

Hiermee geeft u een OData select component. Geef een waarde op voor deze parameter om specifieke eigenschappen op te halen in plaats van alle objecteigenschappen.

Type:String
Position:Named
standaardwaarde:None
Vereist:False
Accept pipeline input:False
Accept wildcard characters:False

Invoerwaarden

String

PSCloudJob

BatchAccountContext

Uitvoerwaarden

PSCloudTask