If you want to create a self-signed certificate using windows power shell. Follow the below instruction
To create the certificate:
1. Launch PowerShell as an administrator.
2. Create the certificate by running the following cmdlet:
New-SelfSignedCertificate -certstorelocation cert:\localmachine\my -dnsname “www.example.com” -NotAfter (Get-Date).AddMonths(60). Note this will create a certificate which expires only after five years.
3. Export the certificate to a file by running the following cmdlet:
Export-Certificate -Cert cert:\localMachine\my\<Thumbprint> -FilePath C:\CommerceShop.cer
To install this certificate
Double click on the certificate then click on install certificate -> Choose store location as Local Machine and in the next screen select store certificate on the following store and select trusted root certification authority.