Enable-AzBatchTask
重新啟用工作。
Syntax
Enable-AzBatchTask
[-JobId] <String>
[-Id] <String>
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Enable-AzBatchTask
[-Task] <PSCloudTask>
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Enable-AzBatchTask Cmdlet 會重新啟用工作。 如果工作已用盡其重試計數,此 Cmdlet 仍可讓它執行。
範例
範例 1:重新啟用工作
Enable-AzBatchTask -JobId "Job7" -Id "Task2" -BatchContext $Context
此命令會重新啟用 Job7 中的工作 Task2。
範例 2:使用管線重新啟用工作
Get-AzBatchTask -JobId "Job8" -Id "Task3" -BatchContext $Context | Enable-AzBatchTask -BatchContext $Context
此命令會使用 Get-AzBatchTask Cmdlet,取得作業中標識碼為 Task3 的 Batch 工作。 命令會使用管線運算符,將該工作傳遞至目前的 Cmdlet。 命令會重新啟用該工作。
參數
-BatchContext
指定 此 Cmdlet 用來與 Batch 服務互動的 BatchAccountContext 實例。 如果您使用 Get-AzBatchAccount Cmdlet 來取得 BatchAccountContext,則與 Batch 服務互動時,將會使用 Microsoft Entra 驗證。 若要改用共用密鑰驗證,請使用 Get-AzBatchAccountKey Cmdlet 來取得已填入其存取密鑰的 BatchAccountContext 物件。 使用共用金鑰驗證時,預設會使用主要存取金鑰。 若要變更要使用的密鑰,請設定 BatchAccountContext.KeyInUse 屬性。
Type: | BatchAccountContext |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Confirm
執行 Cmdlet 之前先提示您確認。
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DefaultProfile
用於與 azure 通訊的認證、帳戶、租用戶和訂用帳戶。
Type: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Id
指定要重新啟用之工作的識別碼。
Type: | String |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-JobId
指定包含工作的作業識別碼。
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Task
指定此 Cmdlet 重新啟用的工作。 若要取得 PSCloudTask 物件,請使用 Get-AzBatchTask Cmdlet。
Type: | PSCloudTask |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-WhatIf
顯示執行 Cmdlet 後會發生的情況。 未執行 Cmdlet。
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
輸入
輸出
相關連結
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應