Hello,
I was always looking for a powershell script to create a self-signed SAN ( Subject Alternative Name ) SSL Certificate for my local lab and projects.
After some tests in my environment finally I got it with a simple PowerShell script.
Here is my experience which I wanted to share if anyone want to use.
New-SelfSignedCertificate -Subject "cn=DOMAINNAME" -DnsName "DOMAINNAME","DOMAINNAME","DOMAINNAME","DOMAINNAME","DOMAINNAME","DOMAINNAME" -KeySpec KeyExchange -KeyUsage DigitalSignature -FriendlyName "ANYNAMECANBE" -CertStoreLocation Cert:\LocalMachine\My -NotAfter $([datetime])::now.addyears(1)
 
Cert:\ Locality can be either LocalUser or Local Machine. It depends on which one you want to use.
Hope it will help.