Get-AzBatchTask
Mendapatkan tugas Batch untuk pekerjaan.
Sintaks
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>]
Deskripsi
Cmdlet Get-AzBatchTask mendapatkan tugas Azure Batch untuk pekerjaan Batch. Tentukan pekerjaan dengan parameter JobId atau parameter Pekerjaan . Untuk mendapatkan satu tugas, tentukan parameter Id . Anda dapat menentukan parameter Filter untuk mendapatkan tugas yang cocok dengan filter Open Data Protocol (OData).
Contoh
Contoh 1: Mendapatkan tugas berdasarkan 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
Perintah ini mendapatkan tugas dengan ID Task03 di bawah pekerjaan Job01. Gunakan cmdlet Get-AzBatchAccountKey untuk menetapkan konteks ke variabel $Context.
Contoh 2: Mendapatkan semua tugas yang diselesaikan dari pekerjaan tertentu
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
Perintah ini mendapatkan tugas yang telah selesai dari pekerjaan yang memiliki ID Job02.
Parameter
-BatchContext
Menentukan instans BatchAccountContext yang digunakan cmdlet ini untuk berinteraksi dengan layanan Batch. Jika Anda menggunakan cmdlet Get-AzBatchAccount untuk mendapatkan BatchAccountContext Anda, autentikasi Microsoft Entra akan digunakan saat berinteraksi dengan layanan Batch. Untuk menggunakan autentikasi kunci bersama sebagai gantinya, gunakan cmdlet Get-AzBatchAccountKey untuk mendapatkan objek BatchAccountContext dengan kunci aksesnya diisi. Saat menggunakan autentikasi kunci bersama, kunci akses utama digunakan secara default. Untuk mengubah kunci yang akan digunakan, atur properti BatchAccountContext.KeyInUse.
Type: | BatchAccountContext |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-DefaultProfile
Kredensial, akun, penyewa, dan langganan yang digunakan untuk komunikasi dengan azure.
Type: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Expand
Menentukan klausa perluasan OData. Tentukan nilai untuk parameter ini untuk mendapatkan entitas terkait dari entitas utama yang akan didapatkan.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Filter
Menentukan klausa filter OData untuk tugas. Jika Anda tidak menentukan filter, cmdlet ini mengembalikan semua tugas untuk akun atau pekerjaan Batch.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Id
Menentukan ID tugas yang didapat cmdlet ini. Anda tidak dapat menentukan karakter kartubebas.
Type: | String |
Position: | 1 |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Job
Menentukan pekerjaan yang berisi tugas yang didapat cmdlet ini. Untuk mendapatkan objek PSCloudJob , gunakan cmdlet Get-AzBatchJob.
Type: | PSCloudJob |
Position: | 0 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-JobId
Menentukan ID pekerjaan yang berisi tugas yang didapat cmdlet ini.
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-MaxCount
Menentukan jumlah maksimum tugas yang akan dikembalikan. Jika Anda menentukan nilai nol (0) atau kurang, cmdlet tidak menggunakan batas atas. Nilai defaultnya adalah 1000.
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Select
Menentukan klausa pilih OData. Tentukan nilai untuk parameter ini untuk mendapatkan properti tertentu daripada semua properti objek.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |