I'm trying to get the output of get-netadapter from powershell, from specific fields in the form of list/dict/json.
PS C:\Users\Administrator> Get-NetAdapter -IncludeHidden | Format-List -Property Name,AdminStatus,DriverFileName
Name : Ethernet0
AdminStatus : Up
DriverFileName : e1i63x64.sys
Name : Ethernet (Kernel Debugger)
AdminStatus : Down
DriverFileName : kdnic.sys
Name : Teredo Tunneling Pseudo-Interface
AdminStatus : Down
DriverFileName :
Name : Microsoft IP-HTTPS Platform Interface
AdminStatus : Down
DriverFileName :
Name : 6to4 Adapter
AdminStatus : Down
DriverFileName :
Required output format in the form of a list/dict/json.
Example format :
(Name: Ethernet0, AdminStatus: Up, DriverFileName : e1i63x64.sys;
Name: Ethernet (Kernel Debugger), AdminStatus: Down, DriverFileName: kdnic.sys)
So the individual adapters are separated by ';' and the individual objects of a single adapter is separated by ','.
I tried using 'join' operator but that doesn't seem to work. ConvertTo-Json doesn't seem work if I use format-list/format-table