TheVMinator
Expert
Expert

Report on VM memory

Jump to solution

How do I list only the virtual machines which have less than a certain amount of RAM?

For example:

something like

get-vm | where-object {$_.propertyname -lt 4096}

(where I use the name of that property and show only VMs less than 4GB)

Thanks

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership

Use the Get-Member cmdlet

Get-VM | gm


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
4 Replies
LucD
Leadership
Leadership

You want the MemoryMB property

get-vm | where-object {$_.MemoryMB -lt 4096}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

TheVMinator
Expert
Expert

OK thanks - also - how do I list all the properties of a given object on the command line?

0 Kudos
LucD
Leadership
Leadership

Use the Get-Member cmdlet

Get-VM | gm


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
TheVMinator
Expert
Expert

great - thanks again

0 Kudos