diff --git a/appveyor12.yml b/appveyor12.yml index e63671860..b08dfe989 100644 --- a/appveyor12.yml +++ b/appveyor12.yml @@ -44,8 +44,6 @@ environment: before_build: - nuget restore - ps: .\prebuild.ps1 -- ps: $psw = ConvertTo-SecureString $env:CertificatePassword -AsPlainText -Force -- ps: Import-PfxCertificate -FilePath Greenshot.pfx -CertStoreLocation cert:\CurrentUser\My -Password $psw build: project: greenshot.sln verbosity: normal diff --git a/prebuild.ps1 b/prebuild.ps1 index 920077f62..6d1333950 100644 --- a/prebuild.ps1 +++ b/prebuild.ps1 @@ -47,9 +47,7 @@ FillCredentials # Write the certificate to a file [System.Convert]::FromBase64String($env:Certificate) | set-content "greenshot.pfx" -encoding byte -# Import it -Import-PfxCertificate -FilePath .\Greenshot.pfx -CertStoreLocation Cert:\CurrentUser\My -Password $env:CertificatePassword - -# Alternative -# $certutilArguments = @('-f','-p', $env:CertificatePassword, '-importpfx', "greenshot.pfx") -# Start-Process -wait certutil -ArgumentList $certutilArguments -NoNewWindow +# Decode password to secure string +$password = ConvertTo-SecureString $env:CertificatePassword -AsPlainText -Force +# Import pfx +Import-PfxCertificate -FilePath .\Greenshot.pfx -CertStoreLocation Cert:\CurrentUser\My -Password $password