In PowerShell v3 we’ve got a new cmdlet: Get-NetAdapter.
So, what can we do with this?
First, what output does this cmdlet give us?
So could you use the help feature in PowerShell to get a view of the possible parameters and syntax this cmdlet offers?
Command: Get-Help Get-NetAdapter
As you can see, there is a –IncludeHidden parameter which include any hidden network adapters in your output:
Command: Get-NetAdapter –IncludeHidden
But there also is a –Physical parameter which will only include physical network adapters in your output?
Command: Get-NetAdapter –Physical
So what if you want to get the virtual network adapters instead of the physical?
Well, there isn’t a cmdlet included for that, so you can simply filter on the property value, right?
Command: Get-NetAdapter | Where {$_.Virtual –eq $True}
You can also easily filter on the description by using the –InterfaceDescription parameters.
For example… let’s get all the network adapters with “Hyper-V” in the description?
Command: Get-NetAdapter –InterfaceDescription “*Hyper-V*”
Here is how you get some basic information about the driver which is used by the adapter
Command: Get-NetAdapter | select name, drivername, majordriverversion, minordriverversion, driverinformation
And to get information about the linkspeed and such?
Command: Get-NetAdapter | select vlandid, promiscuousmode, portnumber, networkaddress, permanentaddress, mediatype
And the last one in the category of information gathering, to get some information about the state and capabilities of the network adapter?
Command: Get-NetAdapter | select transmitlinkspeed, physicalmediatype, mediaconnectionstate, speed, requestedspeed, maxspeed, fullduplex, linkspeed