To create the code signing certificate using PowerShell (using Administrator prompt):
$cert = New-SelfSignedCertificate -Subject "My Certificate" -Type CodeSigning -CertStoreLocation Cert:\CurrentUser\My -NotAfter (Get-Date).AddYears(100)
To export the certificate from the certificate store:
$certPassword = ConvertTo-SecureString -String "passwordhere" -Force –AsPlainText
$cert | Export-PfxCertificate -FilePath "mycert.pfx" -Password $certPassword
To get the base64 string of the SHA1 thumbprint of a PFX certificate use the following: