Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

how to get the correct data

$
0
0

I've seen different way of doing things with PS and I want to learn how to get the data I need.   I struggle with formatting and with data extraction.   I ran this command:

 

Get-WmiObject -Class win32_networkadapter

 

It returns a ton of information that looks like this.

 

ServiceName      : e1cexpress

MACAddress       : 90:B1:1C:6B:0B:7C

AdapterType      : Ethernet 802.3

DeviceID         : 7

Name             : Intel(R) 82579LM Gigabit Network Connection

NetworkAddresses : 

Speed            : 1000000000

 

ServiceName      : NdisWan

MACAddress       : 

AdapterType      : 

DeviceID         : 8

Name             : WAN Miniport (IP)

NetworkAddresses : 

Speed            : 

 

ServiceName      : tunnel

MACAddress       : 

AdapterType      : Tunnel

DeviceID         : 9

Name             : Microsoft ISATAP Adapter

NetworkAddresses : 

Speed            : 100000

 

How do I get "just" the MACAddress?   Some of the MACAddress fields are empty and I only want the MACAddress that is populated.

 

Also, what is this type of data called?   Meaning the PowerShell term for it.  SubData but I know that is not the official name.  I want to know what it's called so I can Google that and learn more.

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles