共用方式為


Get-AzBatchCertificate

取得 Batch 帳戶中的憑證。

語法

Get-AzBatchCertificate
   [-Filter <String>]
   [-MaxCount <Int32>]
   [-Select <String>]
   -BatchContext <BatchAccountContext>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzBatchCertificate
   [-ThumbprintAlgorithm] <String>
   [-Thumbprint] <String>
   [-Select <String>]
   -BatchContext <BatchAccountContext>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

Get-AzBatchCertificate Cmdlet 會取得 BatchContext 參數所指定 Azure Batch 帳戶中的憑證。 若要取得特定憑證,請指定 ThumbprintAlgorithmThumbprint 參數。 指定 Filter 參數,以取得符合 Open Data Protocol (OData) 篩選條件的憑證。

範例

範例 1:依指紋取得憑證

Get-AzBatchCertificate -ThumbprintAlgorithm "sha1" -Thumbprint "C1******7C" -BatchContext $Context

Thumbprint                  : C1******7C
ThumbprintAlgorithm         : sha1
Url                         : https://pstests.eastus.batch.azure.com/certificates(thumbprintAlgorithm=sha1,thumbprint=C1******47
C)
State                       : Active
StateTransitionTime         : 10/6/2015 6:21:16 PM
PreviousState               :
PreviousStateTransitionTime :
Data                        :
CertificateFormat           :
Password                    :
PublicData                  : MI******FJ
DeleteCertificateError      :

此命令會取得具有指定指紋的單一憑證。 憑證指紋演算法為sha1。

範例 2:取得篩選的憑證

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

Thumbprint                  : 025b351b087a084c5067f5e71eff8591970323f9
ThumbprintAlgorithm         : sha1
Url                         : https://pstests.eastus.batch.azure.com/certificates(thumbprintAlgorithm=sha1,thumbprint=02******f9)
State                       : Active
StateTransitionTime         : 10/6/2015 6:21:17 PM
PreviousState               :
PreviousStateTransitionTime :
Data                        :
CertificateFormat           :
Password                    :
PublicData                  : ********************************
DeleteCertificateError      :

Thumbprint                  : C1******7C
ThumbprintAlgorithm         : sha1
Url                         : https://pstests.eastus.batch.azure.com/certificates(thumbprintAlgorithm=sha1,thumbprint=C1******7C)
State                       : Active
StateTransitionTime         : 10/6/2015 6:21:16 PM
PreviousState               :
PreviousStateTransitionTime :
Data                        :
CertificateFormat           :
Password                    :
PublicData                  : ********************************
DeleteCertificateError      :

此命令會從 Batch 帳戶取得處於作用中狀態的所有憑證。 Filter 參數會指定狀態。

參數

-BatchContext

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

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

-DefaultProfile

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

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

-Filter

指定 OData 篩選子句。 如果您指定此參數,這個 Cmdlet 會取得符合篩選條件的憑證。

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

-MaxCount

指定要傳回的憑證數目上限。 如果您指定零 (0) 或更少值,Cmdlet 就不會使用上限。 預設值為 1000。

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

-Select

指定 OData select 子句。 指定此參數的值,以取得特定屬性,而不是所有物件屬性。

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

-Thumbprint

指定這個 Cmdlet 取得之憑證的指紋。

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

-ThumbprintAlgorithm

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

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

輸入

輸出