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 16
16
#>
17
17
param (
18
18
[Parameter (Mandatory = $true )][string ]$catalog ,
19
+ [switch ]$sign ,
19
20
[string ]$description ,
20
21
[string ]$certname ,
21
22
[string ]$certsha1 ,
@@ -31,4 +32,6 @@ MakeCat $catalog
31
32
if (-not $? ) {
32
33
throw " Catalog compilation failed"
33
34
}
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 {
31
31
$certfile = $env: SigningCertificateFile ;
32
32
}
33
33
34
+ if (-not ($certsha1 -or $certname -or $certfile )) {
35
+ throw " No signing certificate specified"
36
+ }
37
+
34
38
foreach ($a in $files ) {
35
39
if ($certsha1 ) {
36
40
SignTool sign / sha1 $certsha1 / fd sha256 / t http:// timestamp.verisign.com / scripts/ timestamp.dll / d $description $a
37
41
} elseif ($certname ) {
38
42
SignTool sign / a / n $certname / fd sha256 / t http:// timestamp.verisign.com / scripts/ timestamp.dll / d $description $a
39
43
} elseif ($certfile ) {
40
44
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
43
45
}
44
46
}
45
47
}
You can’t perform that action at this time.
0 commit comments