Hello, markdjones82-
Your overall code is probably slow due to the manner in which you are using Get-VM. You are calling Get-VM once for every VM in your list of VM names (I assume that your first line of code has a typo, that it is missing the "=" between $vmlist and Get-Content).
Since Get-VM will accept an array of VM names, you can just pass them all in as one value to -Name, and, so, call Get-VM just one time. Like:
$arrVmlist=Get-Contentlist.txt
## call Get-VM just one time, passing all VM names in at once
Get-VM-name$arrVmlist | Select Name,Version | Where-Object {$_.Version -eq"v7"}
Say you have 1000 names in your list of VM names. The original way that you wrote it would call Get-VM 1000 times. Using this way will call Get-VM one single time.
To give an idea of the speed up, I tested each way with about 100 VMs. It took about 8.5 seconds the first way (100 Get-VM calls). It took about 0.3 seconds this way (one Get-VM call). That's about 28 times faster. Not bad for just a minor (but important) change to the way it is written. And, that speed increase should grow as the number of VM names in your list increases.
So, yes, it is pretty important for speed to look for those types of parameters that will take an array of values, rather than having to call the cmdlet one time for every item on which you are acting.
That do any better for you?