This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adapted from Vadims Podāns' amazing work here. | |
# https://www.sysadmins.lv/blog-en/how-to-convert-pkcs12pfx-to-pem-format.aspx | |
# | |
# Also, if you need a more complete PKI PowerShell module, he has authored one here: | |
# https://github.com/Crypt32/PSPKI | |
# | |
# This version of the function includes a few fixes from the module's version of the | |
# function and changes up the output options so you get separate .crt/.key files by | |
# default named the same as the pfx file (or thumbprint if directly referencing a cert). | |
# -IncludeChain adds an additional -chain.pem. Relative paths are now |