Skip to content

Commit 3194b1e

Browse files
authored
Merge pull request #6 from jonconwayuk/DEV
Update Pwsh-Gather.ps1
2 parents e076627 + 95d774f commit 3194b1e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Pwsh-Gather.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
PowerShell.exe -ExecutionPolicy ByPass -File <ScriptName>.ps1 [-Debug]
66
.NOTES
77
Author(s): Jonathan Conway
8-
Modified: 22/04/2020
9-
Version: 1.0
8+
Modified: 23/04/2020
9+
Version: 1.1
1010
#>
1111

1212
Param (
@@ -245,7 +245,7 @@ function Get-NetworkInfo {
245245
}
246246
}
247247

248-
$EthernetConnection = Get-NetAdapter -Physical | Where-Object { $_.Name -like "*Ethernet*" -and $_.Status -eq "Up" }
248+
$EthernetConnection = Get-CimInstance -ClassName 'Win32_NetworkAdapter' | Where-Object { $_.Name -like "*Ethernet Connection*" -or $_.Name -like "*Realtek PCIe*" -and $_.NetConnectionStatus -eq '2' }
249249

250250
if ($null -eq $EthernetConnection) {
251251
$IsOnEthernet = $false

0 commit comments

Comments
 (0)