Hello guys,
i'm trying to automate some VMware ESXi configurations via PowerShell using the VMware.PowerCLI module.
In my script define an array of ip addresses look like this:
$vMotionIps = @("192.168.0.1","192.168.0.2","192.168.0.3")
For the foreach i use this code:
$vmHosts = Get-VMHost
$vMotionIps = @("192.168.0.1","192.168.0.2","192.168.0.3")
foreach ($vmhost in $vmHosts)
{
$vss= Get-VirtualSwitch -VMHost $vmHost -Name vSwitch0
New-VMHostNetworkAdapter -VMHost $vmHost -PortGroup vMotion -VirtualSwitch $vss -VMotionEnabled:$true -IP $vMotionIps -Subnetmask 255.255.255.0
}
The goal is to set one IP from the array for the parameter "-IP", but i got an error message saying "The specified method is not supported"
May i ask you for what's wrong?
Greetings
Chris