Skip to content

Commit

Permalink
#45 Read password from
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbechtold committed Jul 11, 2020
1 parent 7ca127d commit 38cf431
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions resources/sign.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ param ($Exe = $(throw "Exe parameter is required."))
## or unprotected, or use certmgr.msc
# Export-Certificate -Cert (Get-ChildItem Cert:\CurrentUser\My -CodeSigningCert)[0] -FilePath code_signing.crt
## Short circuit locally
# $DRTR_CODESIGN_CERTIFICATE_PASS = ConvertFrom-SecureString -SecureString $mypwd
# $env:DRTR_CODESIGN_CERTIFICATE_PASS = ConvertFrom-SecureString -SecureString $mypwd

## Apply it in CI (PWSH 6+)
try {
$cert = Get-PfxCertificate -FilePath .\code_signing.pfx -Password (ConvertTo-SecureString -String $DRTR_CODESIGN_CERTIFICATE_PASS)
$cert = Get-PfxCertificate -FilePath .\code_signing.pfx -Password (ConvertTo-SecureString -String $env:DRTR_CODESIGN_CERTIFICATE_PASS)
Set-AuthenticodeSignature $Exe -Certificate $cert
} catch {
Write-Host "An error occurred:"
Expand Down

0 comments on commit 38cf431

Please sign in to comment.