vagrant/plugins/guests/windows/scripts/winrs_v3_get_adapters.ps1

12 lines
398 B
PowerShell
Raw Normal View History

2014-03-14 18:23:07 +00:00
$adapters = get-ciminstance win32_networkadapter -filter "macaddress is not null"
$processed = @()
foreach ($adapter in $adapters) {
$Processed += new-object PSObject -Property @{
mac_address = $adapter.macaddress
net_connection_id = $adapter.netconnectionid
interface_index = $adapter.interfaceindex
index = $adapter.index
}
}
convertto-json -inputobject $processed