1 <# 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 #> 17 param( 18 [Parameter(Mandatory=$true)][string]$catalog, 19 [string]$description, 20 [string]$certname, 21 [string]$certsha1, 22 [string]$certfile 23 ) 24 25 $tools = $script:MyInvocation.MyCommand.Path | Split-Path -parent; 26 Import-Module $tools\sdktools.psm1 -WarningAction SilentlyContinue -Force 27 28 Set-Alias MakeCat (Find-Tool "makecat.exe") -Scope Script 29 30 MakeCat $catalog 31 if (-not $?) { 32 throw "Catalog compilation failed" 33 } 34 Sign-File -certname $certname -certsha1 $certsha1 -certfile $certfile -description $description -files @($catalog -replace 'cdf$', 'cat') 35