blob: cc3cd4a2b50cda16f8ee23079e1e1f8155b32069 [file] [log] [blame]
Steve Dower0cd63912018-12-10 18:52:57 -08001<#
2.Synopsis
3 Compiles and signs a catalog file.
4.Description
5 Given the CDF definition file, builds and signs a catalog.
6.Parameter catalog
7 The path to the catalog definition file to compile and
8 sign. It is assumed that the .cat file will be the same
9 name with a new extension.
10.Parameter description
11 The description to add to the signature (optional).
12.Parameter certname
13 The name of the certificate to sign with (optional).
14.Parameter certsha1
15 The SHA1 hash of the certificate to sign with (optional).
16#>
17param(
18 [Parameter(Mandatory=$true)][string]$catalog,
Steve Dower606c66a2019-04-12 11:24:15 -070019 [switch]$sign,
Steve Dower0cd63912018-12-10 18:52:57 -080020 [string]$description,
21 [string]$certname,
22 [string]$certsha1,
23 [string]$certfile
24)
25
26$tools = $script:MyInvocation.MyCommand.Path | Split-Path -parent;
27Import-Module $tools\sdktools.psm1 -WarningAction SilentlyContinue -Force
28
29Set-Alias MakeCat (Find-Tool "makecat.exe") -Scope Script
30
31MakeCat $catalog
32if (-not $?) {
33 throw "Catalog compilation failed"
34}
Steve Dower606c66a2019-04-12 11:24:15 -070035if ($sign) {
36 Sign-File -certname $certname -certsha1 $certsha1 -certfile $certfile -description $description -files @($catalog -replace 'cdf$', 'cat')
37}