Modifier

Partager via


Get-PfxData

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

Syntax

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, any intermediate and root certificates.

Examples

EXAMPLE 1

PS C:\>$mypwd = ConvertTo-SecureString -String "1234" -Force -AsPlainText

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

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

EXAMPLE 2

PS C:\>$NewPwd = ConvertTo-SecureString -String "abcd" -Force -AsPlainText

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

PS C:\>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.

Type:String
Aliases:FullName
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Password

Specifies the password for the imported PFX file.

Type:SecureString
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

A string containing the path to PFX file.

Outputs

Microsoft.CertificateServices.Commands.PFXData

A PFXData object.