Remove-AzBatchJobSchedule

拿掉 Batch 作業排程。

Syntax

Remove-AzBatchJobSchedule
      [-Id] <String>
      [-Force]
      -BatchContext <BatchAccountContext>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

Remove-AzBatchJobSchedule Cmdlet 會移除 Azure Batch 作業排程。

範例

範例 1:刪除 Batch 作業排程

Remove-AzBatchJobSchedule -Id "MyJobSchedule" -BatchContext $Context

此命令會刪除標識子為 MyJobSchedule 的作業排程。 命令會在刪除作業之前提示您進行確認。 使用 Get-AzBatchAccountKey Cmdlet 將內容指派給$Context變數。

範例 2:使用管線刪除 Batch 作業而不進行確認

Get-AzBatchJobSchedule -Id "MyJobSchedule" -BatchContext $Context | Remove-AzBatchJobSchedule -Force -BatchContext $Context

此命令會使用 Get-AzBatchJobSchedule Cmdlet 取得標識符為 MyJobSchedule 的作業排程。 命令會使用管線運算符,將該作業排程傳遞至目前的 Cmdlet。 命令會刪除該作業排程。 因為命令包含 Force 參數,所以不會提示您進行確認。

參數

-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

-Force

強制命令執行,而不要求使用者確認。

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Id

指定要移除之作業排程的識別碼。

Type:String
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

輸入

String

BatchAccountContext

輸出

Void