Hi
You should remove the $_.
Try this one: $version = get-vmhost $vmhost | select version
If you want to get list of the host with the version you can do this:
get-vmhost | select name,version
to get the version & build number, see this post:
Determining the ESX host version and build number with PowerCLI « vmdev.info
Thanks,
Bayu
Bayu Wibowo | VCIX6-DCV/NV
Author of VMware NSX Cookbook http://bit.ly/NSXCookbook
https://github.com/bayupw/PowerNSX-Scripts
https://nz.linkedin.com/in/bayupw | twitter @bayupw