Exporting a Base-64 Encoded x.509 certificate using PowerShell is trivial if you have the Export-Certificate cmdlet available. However, many of the nodes I work with are Windows 7 which unfortunately doesn’t include these cmdlets. Therefore I needed an alternate method of exporting these Base-64 encoded x.509 certificates from these nodes.
So I came up with this little snippet of code:
|$certificate = Get-ChildItem -Path Get-ChildItem -path Cert:\CurrentUser\My\D675AE3AE9F7B56348C17EE527F261CFCEA0FD13|
|$base64certificate = @"|
|Set-Content -Path "$ENV:USERPROFILE\Documents\MyCert.cer" -Value $base64certificate|
Hope someone finds it useful.