Created
April 20, 2021 11:46
-
-
Save jamietre/2238970da046ed5e04c1593e86c9c945 to your computer and use it in GitHub Desktop.
Import local issuer certificates to msys2
This file contains hidden or 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
get-childitem -path cert:\LocalMachine\Root | ForEach-Object { | |
$hash = $_.GetCertHashString() | |
$base64certificate = @" | |
-----BEGIN CERTIFICATE----- | |
$([Convert]::ToBase64String($_.export('Cert'), [System.Base64FormattingOptions]::InsertLineBreaks)) | |
-----END CERTIFICATE----- | |
"@ | |
[System.IO.File]::AppendAllText("$home\windows.pem", $base64certificate) | |
} |
You may need echo -e
there to interpret the \n
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For node: