That output looks normal for the script if the VM name is not matched.
I've just tested with the Vms by the wrong name and got the same output, it still generated the csv when the vm name matched.
I haven't put error handling in to the script, could be something to do at a later date.
It will accept VM names that are an exact match or you can use a wildcard like Server*