Please try this out:
Get-VM | Select Name, Version | Where version -ne "v13"
This one will work just for vSphere 6.5 as the maximum Virtual Hardware Version is 13. The other virtual hardware are listed here: Virtual Machine Compatibility
Please let me know if it helps you.
Yes that will work to return the value. Returning the value is not what i'm having problems with. The problem i'm having is that there should be some way to know if that is the latest, or that there is an upgrade available, some sort of attribute that denotes that i'm not already at the latest version based on the host the VM is running on. The idea is to have my script not need to be updated based on changing versions of underlying ESX... as i would hate to have to update the script every time we upgrade one or more ESX hosts in our environment.
Basically, I don't want to assume and/or hard code a value anywhere in the script. I just can't believe there doesn't seem to be a way to determine that without maintaining a list of versions to go along with underlying ESX versions so a comparison can be made to know if the VM is the right version for the host.