Skip to content

Instantly share code, notes, and snippets.

@valchetski
Last active November 14, 2020 14:50
Show Gist options
  • Save valchetski/41a3413f55aaae59c67d296a6e06d5f5 to your computer and use it in GitHub Desktop.
Save valchetski/41a3413f55aaae59c67d296a6e06d5f5 to your computer and use it in GitHub Desktop.
GenerateCertificate.ps1
$cert = New-SelfSignedCertificate -certstorelocation cert:\localmachine\my -dnsname test.local
$password = ConvertTo-SecureString -String ‘password’ -Force -AsPlainText
$path = ‘cert:\localMachine\my\’ + $cert.thumbprint
Export-PfxCertificate -cert $path -FilePath D:\powershellcert.pfx -Password $password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment