Get-PfxCertificate
Published: February 29, 2012
Updated: August 15, 2012
Applies To: Windows PowerShell 2.0, Windows PowerShell 3.0
Get-PfxCertificate
Syntax
Parameter Set: ByPath Get-PfxCertificate [-FilePath] <String[]> [ <CommonParameters>] Parameter Set: ByLiteralPath Get-PfxCertificate -LiteralPath <String[]> [ <CommonParameters>]
Detailed Description
The Get-PfxCertificate cmdlet gets an object representing each specified .pfx certificate file. A .pfx file includes both the certificate and a private key.
Parameters
-FilePath<String[]>
The full path to the .pfx file of the secured file. The parameter name ("FilePath") is optional.
|
Aliases |
none |
|
Required? |
true |
|
Position? |
1 |
|
Default Value |
none |
|
Accept Pipeline Input? |
true (ByValue, ByPropertyName) |
|
Accept Wildcard Characters? |
false |
-LiteralPath<String[]>
The full path to the .pfx file of the secured file. Unlike FilePath, the value of the LiteralPath parameter is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose it in single quotation marks. Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences.
|
Aliases |
none |
|
Required? |
true |
|
Position? |
named |
|
Default Value |
none |
|
Accept Pipeline Input? |
true (ByPropertyName) |
|
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
-
System.String
You can pipe a string that contains a file path to Get-PfxCertificate.
Outputs
The output type is the type of the objects that the cmdlet emits.
-
System.Security.Cryptography.X509Certificates.X509Certificate2
Get-PfxCertificate returns an object for each certificate that it gets.
Notes
-
When using the Invoke-Command cmdlet to run a Get-PfxCertificate command remotely, and the .pfx certificate file is not password protected, the value of the Authentication parameter of Invoke-Command must be "CredSSP".
Examples
-------------------------- EXAMPLE 1 --------------------------
This command gets information about the Test.pfx certificate on the system.
PS C:\> get-pfxcertificate -filepath C:\windows\system32\Test.pfxPassword: ******Signer Certificate: Matt Berg (Self Certificate)Time Certificate:Time Stamp:Path: C:\windows\system32\zap.pfx
-------------------------- EXAMPLE 2 --------------------------
This command gets a .pfx certificate file from the Server01 remote computer. It uses the Invoke-Command to run a Get-PfxCertificate command remotely.
When the .pfx certificate file is not password-protected, the value of the Authentication parameter of Invoke-Command must be "CredSSP".
PS C:\> invoke-command -computername Server01 -scriptblock {get-pfxcertificate -filepath C:\Text\TestNoPassword.pfx} -authentication CredSSP
Related topics