Knowledge Base
Search
New article
Authentication is disabled (development mode).
Edit article
Title
Tags
Content
<pre><code class="language-powershell"># Initialize an empty string to hold the PEM encoded certificates $certContent = "" Get-ChildItem Cert:\LocalMachine\Root | Foreach-Object { # Convert the certificate to Base64 and format it as PEM $pem = "-----BEGIN CERTIFICATE-----`r`n" + [System.Convert]::ToBase64String( $_.Export([System.Security.Cryptography.X509Certificates.X509ContentType]::Cert ), [System.Base64FormattingOptions]::InsertLineBreaks) + "`r`n-----END CERTIFICATE-----`r`n" $certContent += $pem } # Write the PEM content to the output file Set-Content -Path ca-certificates.pem -Value $certContent</code></pre>
Save
Cancel