Enable-AzBatchJob

啟用 Batch 作業。

Syntax

Enable-AzBatchJob
      [-Id] <String>
      -BatchContext <BatchAccountContext>
      [-DefaultProfile <IAzureContextContainer>]
      [<CommonParameters>]

Description

Enable-AzBatchJob Cmdlet 可啟用 Azure Batch 作業。 啟用作業之後,就可以執行新的工作。

範例

範例 1:啟用 Batch 作業

Enable-AzBatchJob -Id "Job-000001" -BatchContext $Context

此命令會啟用標識碼為 Job-000001 的作業。 使用 Get-AzBatchAccountKey Cmdlet 將內容指派給$Context變數。

參數

-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

-DefaultProfile

用於與 azure 通訊的認證、帳戶、租用戶和訂用帳戶。

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Id

指定此 Cmdlet 啟用之作業的識別碼。

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

輸入

String

BatchAccountContext

輸出

Void