Hi All,
Need some help please, i am writing a script post autodeploy to change IP address of the vmk0 but both of the below do not work for 6.7
$esxcli.network.ip.interface.ipv4.set.Invoke(@{interfacename = 'vmk0'; ipv4 = "10.x.x.x".IP; netmask = "255.255.255.0"; gateway = "10.x.x.x"; type = ‘static’})
also tried this
$esxhost | set-vmhostnetworkadapter -name "vmk0" -IP "x.x.x.x" -SubnetMask "255.255.255.0" -confirm:$false
which says the parameter -name is not valid
Afaik, there is no Name parameter on the Set-VMHostNetworkAdapter cmdlet.
You will first have to do a Get-VMHostNetworkAdapter and pipe that to Set-VMHostNetworkAdapter.
Get-VMHostNetworkAdapter -Name 'vmk0' |
Set-VMHostNetworkAdapter -IP "x.x.x.x" -SubnetMask "255.255.255.0" -confirm:$false
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Afaik, there is no Name parameter on the Set-VMHostNetworkAdapter cmdlet.
You will first have to do a Get-VMHostNetworkAdapter and pipe that to Set-VMHostNetworkAdapter.
Get-VMHostNetworkAdapter -Name 'vmk0' |
Set-VMHostNetworkAdapter -IP "x.x.x.x" -SubnetMask "255.255.255.0" -confirm:$false
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference