我需要以下帮助。我试图以表格格式列出适配器名称和NetbiosOption值。任何帮助将不胜感激。
$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
我得到的结果是这样,而不是表格格式
Name NetBios
---- -------
{Wireless Network Connection, VirtualBox Host-Only Network} {0, 0}
答案 0 :(得分:1)
试试这个:
$nac = gwmi win32_networkadapterconfiguration -filter 'ipenabled="true"'
$nac | %{
New-Object PSObject -Property @{
Name = $_.GetRelated('win32_networkadapter')
NetBios = $_.TcpipNetbiosOptions
}
}