Example:
$certs = Get-ChildItem Cert:\LocalMachine\My $type = [System.Security.Cryptography.X509Certificates.X509ContentType]::Cert # Pick the first cert $certBytes = $certs[0].Export($type) [System.IO.File]::WriteAllBytes("nnn.cer", $certBytes)
Example:
$certs = Get-ChildItem Cert:\LocalMachine\My $type = [System.Security.Cryptography.X509Certificates.X509ContentType]::Cert # Pick the first cert $certBytes = $certs[0].Export($type) [System.IO.File]::WriteAllBytes("nnn.cer", $certBytes)