I need to get a list of properties for multiple server, but I'm stuck with the output of second command in my loop:
$(foreach ( $Net in $Nets ) {
Get-NetAdapterBinding -ComponentID ms_msclient,ms_server,ms_tcpip6 -ErrorAction SilentlyContinue | select Name,DisplayName,Enabled
Get-NetAdapterAdvancedProperty $Net -DisplayName "Speed & Duplex" | select DisplayValue
}) | Format-List
The output of first cmd is correct:
Name : LAN_Clients
DisplayName : Internet Protocol Version 6 (TCP/IPV6)
Enabled : False
Name : LAN_Clients
DisplayName : File and Print Sharing
Enabled : False
Name : LAN_Clients
DisplayName : Client for Microsoft Networks
Enabled : False
The second cmd seems ignored... If I run cmd manually the output is correct:
Get-NetAdapterAdvancedProperty "LAN_Clients" -DisplayName "Speed & Duplex" | select DisplayValue
DisplayValue
------------
Auto Negotiation
What am I doing wrong?