File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 1616#>
1717param (
1818 [Parameter (Mandatory = $true )][string ]$catalog ,
19+ [switch ]$sign ,
1920 [string ]$description ,
2021 [string ]$certname ,
2122 [string ]$certsha1 ,
@@ -31,4 +32,6 @@ MakeCat $catalog
3132if (-not $? ) {
3233 throw " Catalog compilation failed"
3334}
34- Sign- File - certname $certname - certsha1 $certsha1 - certfile $certfile - description $description - files @ ($catalog -replace ' cdf$' , ' cat' )
35+ if ($sign ) {
36+ Sign- File - certname $certname - certsha1 $certsha1 - certfile $certfile - description $description - files @ ($catalog -replace ' cdf$' , ' cat' )
37+ }
Original file line number Diff line number Diff line change @@ -31,15 +31,17 @@ function Sign-File {
3131 $certfile = $env: SigningCertificateFile ;
3232 }
3333
34+ if (-not ($certsha1 -or $certname -or $certfile )) {
35+ throw " No signing certificate specified"
36+ }
37+
3438 foreach ($a in $files ) {
3539 if ($certsha1 ) {
3640 SignTool sign / sha1 $certsha1 / fd sha256 / t http:// timestamp.verisign.com / scripts/ timestamp.dll / d $description $a
3741 } elseif ($certname ) {
3842 SignTool sign / a / n $certname / fd sha256 / t http:// timestamp.verisign.com / scripts/ timestamp.dll / d $description $a
3943 } elseif ($certfile ) {
4044 SignTool sign / f $certfile / fd sha256 / t http:// timestamp.verisign.com / scripts/ timestamp.dll / d $description $a
41- } else {
42- SignTool sign / a / fd sha256 / t http:// timestamp.verisign.com / scripts/ timestamp.dll / d $description $a
4345 }
4446 }
4547}
You can’t perform that action at this time.
0 commit comments