Edit

Share via


Get-PfxData

Extracts the content of a Personal Information Exchange (PFX) file into a structure without importing it to certificate store.

Syntax

Default (Default)

Get-PfxData
    [-Password <SecureString>]
    [-FilePath] <String>
    [<CommonParameters>]

Description

The Get-PfxData cmdlet extracts the content of a Personal Information Exchange (PFX) file into a structure that contains the end entity certificate, and any intermediate and root certificates.

Examples

EXAMPLE 1

$mypwd = ConvertTo-SecureString -String '1234' -Force -AsPlainText

$mypfx = Get-PfxData -FilePath C:\mypfx.pfx -Password $mypwd

This example returns certificate information for the file C:\mypfx.pfx that is secured with the specified password.

EXAMPLE 2

$NewPwd = ConvertTo-SecureString -String 'abcd' -Force -AsPlainText

$mypfx = Get-PfxData -FilePath C:\mypfx.pfx -Password $OldPwd

Export-PfxCertificate -PfxData $mypfx -FilePath C:\mypfx.pfx -Password $NewPwd -Force

This example shows how one can change an existing password for mypfx.pfx file from $OldPwd to $NewPwd.

Parameters

-FilePath

Specifies the path to the PFX file.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:FullName

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Password

Specifies the password for the imported PFX file.

Parameter properties

Type:System.SecureString
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

String

A string containing the path to PFX file.

Outputs

Microsoft.CertificateServices.Commands.PFXData

A PFXData object.