Skip to content

Commit 4af83ca

Browse files
committed
Added check to Find-SqlServerService to only add a found instance to the collection if it doesn't exist in the collection.
1 parent c09d993 commit 4af83ca

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Modules/NetworkScan/NetworkScan.psm1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1593,7 +1593,9 @@ function Find-SqlServerService {
15931593
)
15941594

15951595
# Add the discovered instance to the found instance collection
1596-
$InstanceCollection += $InstanceName
1596+
if ($InstanceCollection -inotcontains $InstanceName) {
1597+
$InstanceCollection += $InstanceName
1598+
}
15971599
}
15981600
}
15991601
catch {

0 commit comments

Comments
 (0)