Skip to content

Commit 4d1c0b3

Browse files
committed
Suppress warning message on Port Test, Get-EternalBlueVulnerabilityStatistics.
1 parent 93dc00e commit 4d1c0b3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Functions/Get-EternalBlueVulnerabilityStatistics.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ begin {
188188

189189
# SMB1Port Data
190190
Write-Progress -Activity "Gathering EternalBlue vulnerability information from '$nameValue'" -CurrentOperation "Retrieve SMB port state" -PercentComplete 100
191-
$port139TestConnection = (Test-NetConnection -ComputerName $CimSession.ComputerName -Port 139).TcpTestSucceeded
192-
$port445TestConnection = (Test-NetConnection -ComputerName $CimSession.ComputerName -Port 445).TcpTestSucceeded
191+
$port139TestConnection = (Test-NetConnection -ComputerName $CimSession.ComputerName -Port 139 -WarningAction SilentlyContinue).TcpTestSucceeded
192+
$port445TestConnection = (Test-NetConnection -ComputerName $CimSession.ComputerName -Port 445 -WarningAction SilentlyContinue).TcpTestSucceeded
193193

194194
return [PSCustomObject]@{
195195
PSComputerName = $CimSession.ComputerName

0 commit comments

Comments
 (0)