File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1
1
$ErrorActionPreference = " Stop"
2
2
3
+ Import-Module BitsTransfer
4
+
3
5
$opensslPath = " $ENV: HOMEDRIVE \OpenSSL-Win32"
4
6
5
7
function VerifyHash ($filename , $expectedHash ) {
6
8
$hash = (Get-FileHash - Algorithm SHA1 $filename ).Hash
7
9
if ($hash -ne $expectedHash ) {
8
- throw " SHA1 hash not valid for file: $filename "
10
+ throw " SHA1 hash not valid for file: $filename . Expected: $expectedHash Current: $hash "
9
11
}
10
12
}
11
13
12
14
function InstallOpenSSL () {
13
15
if (! (Test-Path $opensslPath )) {
14
16
$filename = " Win32OpenSSL_Light-1_0_1i.exe"
15
- Invoke-WebRequest - Uri " http://slproweb.com/download/$filename " - OutFile $filename
17
+ Start-BitsTransfer - Source " http://slproweb.com/download/$filename " - Destination $filename
16
18
17
- VerifyHash $filename " 303A6010192161C3BA103978DD4D6932CA9340DC "
19
+ VerifyHash $filename " 439BA19F18803432E39F0056209B010A63B96644 "
18
20
19
21
Start-Process - Wait - FilePath $filename - ArgumentList " /silent /verysilent /sp- /suppressmsgboxes"
20
22
del $filename
You can’t perform that action at this time.
0 commit comments