Skip to content

Instantly share code, notes, and snippets.

@lansalot
Created January 31, 2020 09:16
Show Gist options
  • Save lansalot/976f0b69a7ecca31ce95ec9f28cbd59f to your computer and use it in GitHub Desktop.
Save lansalot/976f0b69a7ecca31ce95ec9f28cbd59f to your computer and use it in GitHub Desktop.
$cert = New-SelfSignedCertificate -DnsName contoso.com -Type CodeSigning -CertStoreLocation Cert:\CurrentUser\My
# But if you try to sign, you'll get UnknownError because it's not in the trusted Root store. So do this to get it there
Export-Certificate -FilePath exported_cert.cer -Cert $cert
Import-Certificate -FilePath exported_cert.cer -CertStoreLocation Cert:\CurrentUser\Root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment