Examples: Using Get-VM and Where-Object

I had two cases last week where I needed to get a certain subset of VM’s and specified properties from Virtual Machine Manager.  The first scenario involved SQL servers, which due to our server naming convention was fairly easy.

The next scenario involved using a list of VM’s that was provided in a text file.  I initially struggled with this but eventually got it worked out using the two lines below.  You could also do it in one line but that gets kind of messy.