when I run the whole script: everything works!
Vm's get in the CSV get registered, they get their new display name and vlan with input from the CSV.
I just get one error message, but the script continue to run:
Get-VM : 22/03/2013 14:29:15 Get-VM VM with name 'oldname' was not found using the specified filter(s).
At line:2 char:9