Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect Ethernet adapter(s) - PowerShell

Tags:

powershell

I am using this code to detect network adapters:

(Get-NetAdapter).InterfaceDescription

The problem with this code is that it detects all network adapters (including Wi-Fi and virtual adapters by VMware).

I just want to detect the ethernet adapters installed in the device.

Could PowerShell do this at all?

like image 880
Se7en Avatar asked Dec 06 '25 02:12

Se7en


1 Answers

(Get-NetAdapter -Physical | Where-Object {$_.PhysicalMediaType -eq "802.3"}).InterfaceDescription

Will get all physical network adapters having PhysicalMediaType 802.3 (Ethernet).

like image 74
Jonas Tuemand Møller Avatar answered Dec 07 '25 16:12

Jonas Tuemand Møller