Filter vSphere Objects with Get-View
You can use the Get-View cmdlet to filter vSphere objects before performing various actions on them.
The filter parameter is a HashTable object containing one or more pairs of filter criteria. Each of the criteria consists of a property path and a value that represents a regular expression pattern used to match the property.
Prerequisites
Verify that you are connected to a vCenter Server system.
Procedure
Results
The filter gets a list of the powered-on virtual machines whose guest OS names contain the string Windows XP
. The Get-View cmdlet then initiates shutdown for each guest operating system in the list.