adding a network adapter

Oct 26, 2009 at 4:11 PM

I would like to duplicate the following Hyper-V steps using the PowerShell commands:

Settings (for a VM) > Add Hardware > choose "Network Adapter"

"Network Adapter" is part of the default Hyper-V configuration

(select newly added adapter) > Network > (select an existing network)

I have tried a number of commands including Add-VMNIC with various parameters and cannot get it to duplicate the manual steps.

For instance, when I execute:

add-vmnic -vm test -virtualswitch "Network Adapter"

it adds a "VMBus Network Adapter" rather than "Network Adapter" and other values are not auto-generated like they are using the Hyper-V click-and-type method.

Any help is appreciated.

- Chris

 

Coordinator
Oct 31, 2009 at 4:24 PM

VM bus adapter is just an explicit name for what HyperV calls simply a Network adapter.

In the R2 there are constants defined so you can change the names without having to delve into the code of Add-VMNic. If you are using the initial release you can search for "VMBus network Adapter" and change it.

May 16, 2012 at 9:30 AM
Edited May 16, 2012 at 2:17 PM

How can I change "vm-bus Network Interface" by "Network interface" when a Nic is created using add-vmnic?

I'll have to maintain the same criteria that script produces with the options that HYPER-V screen shows when a network is selected using the GUI interface.

In which files are located these Constants?

 

I'll appreciate.