I have tested and when this script is run, the variable $VM (which contains alls VMs) is overwritten by the last VM checked.
I have checked the number of objects in variable $VM and when this script is run, the count is 1 (the last one) causing next scripts to fail (as I only have 1 VM).
I have tested and when this script is run, the variable $VM (which contains alls VMs) is overwritten by the last VM checked. I have checked the number of objects in variable $VM and when this script is run, the count is 1 (the last one) causing next scripts to fail (as I only have 1 VM).