创建证书
New-SelfSignedCertificate -FriendlyName 证书名称 -DnsName 域名主机 -CertStoreLocation Cert:\LocalMachine\My -KeyUsage DigitalSignature -NotAfter (Get-Date).AddYears(10)
导出PFX证书
$mypwd = ConvertTo-SecureString -String '1234' -Force -AsPlainText
Get-ChildItem -Path Cert:\LocalMachine\My\证书哈希 | Export-PfxCertificate -FilePath C:\mypfx.pfx -Password $mypwd