Skip to content

Commit c6e64ab

Browse files
committed
appveyor: Fix PS scripts
1 parent f7d67a3 commit c6e64ab

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

appveyor.yml

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,56 +5,36 @@ environment:
55
UnitsNetPfxSecret:
66
secure: Dibuvlff8E8XYIVHZFh+y632RN23ZamvKEJE9NNf/GM=
77
install:
8-
- ps: >-
8+
- ps: |
99
Write-Host -ForegroundColor Yellow "Install 'secure-file' tool..."
10-
1110
nuget install secure-file -ExcludeVersion
1211
13-
1412
Write-Host -ForegroundColor Yellow "Decrypt UnitsNet.pfx..."
15-
1613
.\secure-file\tools\secure-file -decrypt Build\UnitsNet.pfx.enc -secret $env:UnitsNetPfxEncSecret
1714
18-
1915
$pfx = Resolve-Path "Build\UnitsNet.pfx"
20-
2116
$password = $env:UnitsNetPfxSecret
22-
2317
$keyContainerName = "VS_KEY_53797375DF3695DD"
2418
25-
2619
# Import certificate
27-
2820
Write-Host -ForegroundColor Yellow "Import $pfx ..."
29-
3021
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
31-
3222
$cert.Import($pfx, $password, [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]::Exportable)
33-
3423
$exportPrivateKeyInformation = $true
35-
3624
$certXml = $cert.PrivateKey.ToXmlString($exportPrivateKeyInformation)
3725
38-
3926
$csp = New-Object System.Security.Cryptography.CspParameters
40-
4127
$csp.KeyContainerName = $keyContainerName
42-
4328
$csp.Flags = [System.Security.Cryptography.CspProviderFlags]::UseMachineKeyStore -bor [System.Security.Cryptography.CspProviderFlags]::NoPrompt # -bor is biwise or
44-
4529
$csp.KeyNumber = [System.Security.Cryptography.KeyNumber]::Signature
4630
47-
4831
$rsa = New-Object System.Security.Cryptography.RSACryptoServiceProvider $csp
49-
5032
$rsa.FromXmlString($certXml)
51-
5233
$rsa.Clear()
5334
54-
5535
Write-Output "Sucesfully imported $pfx into StrongName CSP store"
5636
build_script:
57-
- ps: >-
37+
- ps: |
5838
#####################################
5939
# Build, test, pack and deploy nugets
6040
#####################################

0 commit comments

Comments
 (0)