This is how I did it;
A table of vm hostnames (column 1) and target IP addresses (column 2) was created in Excel and saved as a csv.
The below script then reads the file and changes the network to the one in that vapp called “desktop-org<something>”, and gives the VM the IP address from column 2. The VM must be off.
$csv = import-csv h:\ps1\book1.csv
foreach ($line in $csv) {
write-host **** Changing $line.vm to new network and $line.ipaddress ****
$targetvm = $line.vm
$targetip = $line.ipaddress
$targetvAppnet = get-civm $targetvm | foreach-object {get-civapp $_.vapp} | get-civappnetwork | where {$_.name -match "Desktops-org"}
get-civm $line.vm | Get-CINetworkAdapter | Set-CINetworkAdapter -IPAddressAllocationMode Manual -ipaddress $targetip -VAppNetwork $targetVAppNet -connected $true