$params = @{DnsName = 'www.fabrikam.com', 'www.contoso.com'
CertStoreLocation = 'Cert:\LocalMachine\My' }
New-SelfSignedCertificate @params
OR
New-SelfSignedCertificate -DnsName 'www.fabrikam.com','www.contoso.com' -CertStoreLocation Cert:\LocalMachine\My
These two examples create a self-signed SSL server certificate in the computer MY store with the subject alternative names www.fabrikam.com and www.contoso.com and the Subject and Issuer name set to www.fabrikam.com. (First one will be set to subject/Issuer unless otherwise indicated.