PowerShell to read PFX certificate file

Here is quick PowerShell script to read PFX certificate file

$mypwd = ConvertTo-SecureString -String "password"-Force -AsPlainText
$mycert = get-pfxdata -filepath "mytest.pfx" -Password $mypwd
$mycert.EndEntityCertificates | Select-Object -Property *

# write to JSON
#$myjson = ConvertTo-Json $mycert.EndEntityCertificates -Depth 100 
#$myjson | Out-File -FilePath pfxoutput.json

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Blog at WordPress.com.

Up ↑