Skip to content

Commit 51d6229

Browse files
committed
Updated HotFixID Query to use Where-Object instead of .Where() to support older versions of PowerShell.
1 parent 0a12f45 commit 51d6229

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Functions/Get-EternalBlueVulnerabilityStatistics.ps1

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<#PSScriptInfo
22
33
.Version
4-
1.1
4+
1.2
55
.Guid
66
038a1c05-b1da-48c9-893d-4084b99f831b
77
.Author
@@ -13,7 +13,7 @@
1313
.ExternalModuleDependencies
1414
NetTCPIP
1515
.ReleaseNotes
16-
Missed the -ErrorAction Stop in the Test-WSMan call, this is needed to fall back to DCOM.
16+
Updated HotFixID Query to use Where-Object instead of .Where() to support older versions of PowerShell.
1717
1818
#>
1919

@@ -161,9 +161,10 @@ begin {
161161

162162
# Hotfix Data
163163
Write-Progress -Activity "Gathering EternalBlue vulnerability information from '$nameValue'" -CurrentOperation "Retrieve operating hotfix id" -PercentComplete 40
164-
$appliedHotFixID = (Get-CimInstance -CimSession $CimSession -ClassName Win32_QuickFixEngineering).Where({
165-
$_.HotFixID -in $HotfixIDs
166-
}).HotFixID
164+
$appliedHotFixID = (Get-CimInstance -CimSession $CimSession -ClassName Win32_QuickFixEngineering |
165+
Where-Object {
166+
$_.HotFixID -in $HotfixIDs
167+
}).HotFixID
167168

168169
# SMB1Feature Data
169170
Write-Progress -Activity "Gathering EternalBlue vulnerability information from '$nameValue'" -CurrentOperation "Retrieve SMB1 feature state" -PercentComplete 60

0 commit comments

Comments
 (0)