Skip to content

Instantly share code, notes, and snippets.

@norman-bauer
Created April 11, 2022 11:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save norman-bauer/c46c60336743b23e02e45356dae79472 to your computer and use it in GitHub Desktop.
Save norman-bauer/c46c60336743b23e02e45356dae79472 to your computer and use it in GitHub Desktop.
Converts certificate installed in machine store to pem file
Install-Module -Name PSPKI
Import-Module -Name PSPKI
$cert = @(Get-ChildItem cert:\LocalMachine\My | Where-Object {$_.Subject -like "*CertificateSubject*"})[0]
Convert-PfxToPem -Certificate $cert -OutputFile "c:\temp\output.pem"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment