取得電腦中 .pfx 憑證檔案的相關資訊。

語法

Get-PfxCertificate [-FilePath] <string[]> [<CommonParameters>]

描述

Get-PfxCertificate Cmdlet 會取得代表每個指定之 .pfx 憑證檔案的物件。.pfx 檔案同時包含憑證及私密金鑰。

參數

-FilePath <string[]>

受保護檔案的 .pfx 檔案完整路徑。參數名稱 ("FilePath") 為選擇項。

必要?

true

位置?

1

預設值

接受管線輸入?

true (ByValue, ByPropertyName)

接受萬用字元?

false

<CommonParameters>

這個 Cmdlet 支援一般參數:-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer 和 -OutVariable。如需詳細資訊,請參閱 about_Commonparameters.

輸入和輸出

輸入型別是可經由管道輸出至 Cmdlet 的物件型別。傳回型別則是 Cmdlet 所傳回的物件型別。

輸入

System.String

您可經由管道將包含檔案路徑的字串輸出至 Get-PfxCertificate。

輸出

System.Security.Cryptography.X509Certificates

Get-PfxCertificate 會針對它所取得的每個憑證傳回一個物件。

附註

如果使用 Invoke-Command Cmdlet 在遠端執行 Get-PfxCertificate 命令,而且 .pfx 憑證檔案未受到密碼保護,則 Invoke-Command 的 Authentication 參數值必須為 "CredSSP"。

範例 1

C:\PS>get-pfxcertificate -filepath C:\windows\system32\Test.pfx

Password: ******
Signer Certificate:      Matt Berg (Self Certificate)
Time Certificate:
Time Stamp:
Path:                    C:\windows\system32\zap.pfx

描述
-----------
這個命令取得系統中 Test.pfx 憑證的相關資訊。






範例 2

C:\PS>invoke-command -computername Server01 -scriptblock {get-pfxcertificate -filepath C:\Text\TestNoPassword.pfx} -authentication CredSSP

描述
-----------
這個命令會從 Server01 遠端電腦取得 .pfx 憑證檔案。它會使用 Invoke-Command 在遠端執行 Get-PfxCertificate 命令。

如果 .pfx 憑證檔案未受到密碼保護,則 Invoke-Command 的 Authentication 參數值必須為 "CredSSP"。






請參閱




目錄