Hi
I am trying to enumerate all my NIC’s and display the name and raw MAC address to look something like:
`
Name MacAddress
NIC4 C8-1F-66-F7-1B-78
NIC3 C8-1F-66-F7-1B-77
NIC2 C8-1F-66-F7-1B-76
NIC1 C8-1F-66-F7-1B-75`
I am using the following
`# Get Adapter Name & MAC Address for each adapter and remove Dashes From MAC Address
$Adapters = Get-NetAdapter | Select Name, MACAddress | ForEach {$_.MacAddress -replace “-”,“”}
$Adapters`
but this only displays the raw MAC address.
Why is the Name stripped out when the ForEach cmdlet is run?
Thanks
Tony