共用方式為


Remove-AzBatchCertificate

從帳戶中刪除憑證。

語法

Remove-AzBatchCertificate
      [-ThumbprintAlgorithm] <String>
      [-Thumbprint] <String>
      -BatchContext <BatchAccountContext>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

Remove-AzBatchCertificate Cmdlet 會從指定的 Azure Batch 帳戶中移除憑證。

範例

範例 1:移除憑證

Remove-AzBatchCertificate -ThumbprintAlgorithm "sha1" -Thumbprint "c1e494a415149c5f211c4778b52f2e834a07247c" -BatchContext $Context

此命令會移除具有指定指紋的憑證。

範例 2:移除所有使用中的憑證

Get-AzBatchCertificate -Filter "state eq 'active'" -BatchContext $Context | Remove-AzBatchCertificate -BatchContext $Context

此命令會使用 Get-AzBatchCertificate Cmdlet 取得使用中的所有憑證。 命令會使用管線運算符,將作用中的憑證傳遞至目前的 Cmdlet。 該 Cmdlet 會移除每個憑證。

參數

-BatchContext

指定 此 Cmdlet 用來與 Batch 服務互動的 BatchAccountContext 實例。 如果您使用 Get-AzBatchAccount Cmdlet 來取得 BatchAccountContext,則與 Batch 服務互動時,將會使用 Microsoft Entra 驗證。 若要改用共用密鑰驗證,請使用 Get-AzBatchAccountKey Cmdlet 來取得已填入其存取密鑰的 BatchAccountContext 物件。 使用共用金鑰驗證時,預設會使用主要存取金鑰。 若要變更要使用的密鑰,請設定 BatchAccountContext.KeyInUse 屬性。

類型:BatchAccountContext
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-Confirm

執行 Cmdlet 之前先提示您確認。

類型:SwitchParameter
別名:cf
Position:Named
預設值:False
必要:False
接受管線輸入:False
接受萬用字元:False

-DefaultProfile

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

類型:IAzureContextContainer
別名:AzContext, AzureRmContext, AzureCredential
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Thumbprint

指定此 Cmdlet 刪除之憑證的指紋。

類型:String
Position:1
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-ThumbprintAlgorithm

指定用來衍生 Thumbprint 參數的演算法。 目前,唯一有效的值為sha1。

類型:String
Position:0
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-WhatIf

顯示執行 Cmdlet 後會發生的情況。 未執行 Cmdlet。

類型:SwitchParameter
別名:wi
Position:Named
預設值:False
必要:False
接受管線輸入:False
接受萬用字元:False

輸入

String

BatchAccountContext

輸出

Void