Skip to content

Commit 2cdb980

Browse files
committed
Update PSDiscoveryProtocol.psm1
1 parent 52e6dba commit 2cdb980

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Source/NETworkManager.Models/Resources/PSDiscoveryProtocol.psm1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ function Invoke-DiscoveryProtocolCapture {
188188

189189
try {
190190
$CimSession = @{
191-
CimSession = New-CimSession -ComputerName $Computer -ErrorAction Stop
191+
CimSession = New-CimSession -ComputerName $Computer -ErrorAction Stop
192192
}
193193
} catch {
194194
Write-Warning "Unable to create CimSession. Please make sure WinRM and PSRemoting is enabled on $Computer."
@@ -197,7 +197,6 @@ function Invoke-DiscoveryProtocolCapture {
197197

198198
$PSSession = @{
199199
Session = New-PSSession -ComputerName $Computer
200-
201200
}
202201
}
203202

@@ -252,7 +251,7 @@ function Invoke-DiscoveryProtocolCapture {
252251
LinkLayerAddress = $LinkLayerAddress
253252
}
254253

255-
Add-NetEventPacketCaptureProvider @PacketCaptureParams | Out-Null
254+
Add-NetEventPacketCaptureProvider @PacketCaptureParams @CimSession | Out-Null
256255
Add-NetEventNetworkAdapter -Name $Adapter.Name -PromiscuousMode $True @CimSession | Out-Null
257256

258257
Start-NetEventSession -Name $SessionName @CimSession

0 commit comments

Comments
 (0)