So I ran this:
$vmh = Get-VMHost -Name "myhost" (assumed needed for extension data reference)
$vds = Get-VDSwitch -Name "LVA-Management" (assumed needed for extension data reference)
$vpg = $vds | Get-VDPortgroup -Name "Management Network" (assumed needed for extension data reference)
$dvSwitchName = "LVA-Management"
$dvPortgroupName = "Management Network"
$dvSCIp = "192.168.1.1"
$dvSCMask = "255.255.255.0"
$netSys = Get-View $vmh.ExtensionData.ConfigManager.NetworkSystem
$nic = New-Object VMware.Vim.HostVirtualNicSpec
$nic.ip = New-Object VMware.Vim.HostIpConfig
$nic.ip.dhcp = $false
$nic.ip.ipAddress = $dvSCIp
$nic.ip.subnetMask = $dvSCMask
$nic.distributedVirtualPort = New-Object VMware.Vim.DistributedVirtualSwitchPortConnection
$nic.distributedVirtualPort.switchUuid = $vds.ExtensionData.Uuid
$nic.distributedVirtualPort.portgroupKey = $vpg.ExtensionData.MoRef.Value
$vnicName = $netSys.AddVirtualNic("", $nic)
$vnicMgr = Get-View $vmh.ExtensionData.ConfigManager.VirtualNicManager
$vnicMgr.SelectVnicForNicType("management", $vnicName)
And get this...
Exception calling "AddVirtualNic" with "2" argument(s): "A specified parameter was not correct.
PortConnection.switchUuid"
At line:22 char:34
+ $vnicName = $netSys.AddVirtualNic <<<< ($dvPortgroupName, $nic)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
Exception calling "SelectVnicForNicType" with "2" argument(s): "A specified parameter was not correct.
"
At line:25 char:30
+ $vnicMgr.SelectVnicForNicType <<<< ("management", $vnicName)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
I'm sure im missing something....