Created
April 23, 2013 10:45
-
-
Save BenNeise/5442585 to your computer and use it in GitHub Desktop.
Find machines where the configured memory is greater than 2000, and filter those machines to display only those with Windows XP guests.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Loop through each VM | |
ForEach ($objVM in ( | |
Get-VM | Where-Object { | |
# Where the configured memory is greater than 2000 | |
$_.MemoryMB -gt "2000" | |
} | |
)){ | |
# Get the VM guest object | |
Get-VMGuest -VM $objVM | Where-Object { | |
# Where the operating system is Windows XP | |
$_.OSFullName -like "Microsoft Windows XP Professional*" | |
# And display the VM object name, the guest hostname, and the memory in MB | |
} | Select-Object VMName,Hostname,MemoryMB | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment