Try the following, this will create a DER format certificate. Let me know if 11 is okay with that;
$Password = Read-Host -AsSecureString
$Pfx = "C:\SmarterMail\certificate.pfx"
$Cer = "C:\SmarterMail\certificate.cer"
Export-Certificate -Type CERT -Cert ([System.Security.Cryptography.X509Certificates.X509Certificate2]::new($Pfx, $Password, "Exportable,PersistKeySet,MachineKeySet")) -FilePath $Cer
You can then use the following to securely script the export (this is securely tied to the user that creates the converted secure string);
$ConvertedSecureString = ConvertFrom-SecureString $Password
The HEX from $ConvertedSecureString can be added to your script e.g.
$ConvertedSecureString = e3f5a7b3................
$Password = ConvertTo-SecureString -string $ConvertedSecureString
The 2 lines above replaced the Read-Host line in the first set of commands.
Let me know how you get on,
Steve