Skip to content

Commit 0a12f45

Browse files
committed
Missed the -ErrorAction Stop in the Test-WSMan call, this is needed to fall back to DCOM.
1 parent a4ad044 commit 0a12f45

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Functions/Get-EternalBlueVulnerabilityStatistics.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<#PSScriptInfo
22
33
.Version
4-
1.0
4+
1.1
55
.Guid
66
038a1c05-b1da-48c9-893d-4084b99f831b
77
.Author
@@ -13,7 +13,7 @@
1313
.ExternalModuleDependencies
1414
NetTCPIP
1515
.ReleaseNotes
16-
Refactor of Test-WannaCryVulnerability, uses a CIM Session to gather data, rather then multiple WMI calls.
16+
Missed the -ErrorAction Stop in the Test-WSMan call, this is needed to fall back to DCOM.
1717
1818
#>
1919

@@ -208,7 +208,7 @@ process {
208208
foreach ($nameValue in $Name) {
209209
try {
210210
$protocol = "WSMAN"
211-
$protocolTest = Test-WSMan -ComputerName $name
211+
$protocolTest = Test-WSMan -ComputerName $name -ErrorAction Stop
212212
if ($null -eq $protocolTest -or $protocol.ProductVersion -contains "Stack: 2.0") {
213213
$protocol = "DCOM"
214214
}

0 commit comments

Comments
 (0)