Fix 4c8f1b0f81: First entry of station cargo filter list was broken. (#13382)
[openttd-github.git] / os / windows / winstore / generate-key.ps1
blobf59eb038e405e852d4de7a44e3594fa3584625e7
1 [CmdletBinding()]
2 [Alias()]
3 Param
5 # Publisher ("CN=xyz")
6 [Parameter(Mandatory=$true, Position=0)]
7 $Publisher,
9 # Password
10 [Parameter(Mandatory=$true, Position=1)]
11 $PasswordParam,
13 # Filename
14 [Parameter(Mandatory=$true, Position=2)]
15 $OutputFilename
18 $cert = New-SelfSignedCertificate -Type Custom -Subject $Publisher -KeyUsage DigitalSignature -FriendlyName "OpenTTD signing certificate" -CertStoreLocation "Cert:\CurrentUser\My" -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.3", "2.5.29.19={text}")
20 $password = ConvertTo-SecureString -String $PasswordParam -Force -AsPlainText
21 Export-PfxCertificate -cert "Cert:\CurrentUser\My\$($cert.Thumbprint)" -FilePath $OutputFilename -Password $password