Skip to content

Commit fbab9e2

Browse files
committed
Updates SetupWinRMAccessSelfSigned.ps1
1 parent 9059e7a commit fbab9e2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

SetupWinRMAccessSelfSigned.ps1

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
$ErrorActionPreference = "Stop"
22

3+
Import-Module BitsTransfer
4+
35
$opensslPath = "$ENV:HOMEDRIVE\OpenSSL-Win32"
46

57
function VerifyHash($filename, $expectedHash) {
68
$hash = (Get-FileHash -Algorithm SHA1 $filename).Hash
79
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"
911
}
1012
}
1113

1214
function InstallOpenSSL() {
1315
if (!(Test-Path $opensslPath)) {
1416
$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
1618

17-
VerifyHash $filename "303A6010192161C3BA103978DD4D6932CA9340DC"
19+
VerifyHash $filename "439BA19F18803432E39F0056209B010A63B96644"
1820

1921
Start-Process -Wait -FilePath $filename -ArgumentList "/silent /verysilent /sp- /suppressmsgboxes"
2022
del $filename

0 commit comments

Comments
 (0)