Skip to content

Instantly share code, notes, and snippets.

@valchetski
valchetski / GenerateCertificate.ps1
Last active November 14, 2020 14:50
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