0

I need help with the following. I am trying to list the Adapter Name and NetbiosOption value in a table format. Any help will be appreciated.

  $nac = gwmi win32_networkadapterconfiguration -filter 'ipenabled="true"' 
  $na = $nac | %{$_.GetRelated('win32_networkadapter')}
  $prop = @{'Name' = $na.NetConnectionID;
        'NetBios' = $nac.TcpipNetbiosOptions
         }
  $obj = New-Object -TypeName PSObject -Property $prop
  $obj

I am getting the result like this and not in table format

Name                                                                                       NetBios                                                                                   
----                                                                                       -------                                                                                   
{Wireless Network Connection, VirtualBox Host-Only Network}                                {0, 0}  

1 Answer 1

1

Try this:

$nac = gwmi win32_networkadapterconfiguration -filter 'ipenabled="true"' 
$nac | %{
  New-Object PSObject -Property @{
   Name = $_.GetRelated('win32_networkadapter')
   NetBios = $_.TcpipNetbiosOptions
  }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.