Get-Member

Get-Member is a very useful command throughout the Powershell based applications which I use every day.

Command | Get-Member

This command gives you a list of all the attributes against the method type and the definition. This is extremely useful if you are unsure on an attribute, see my example below where I want to know the attribute for the Hosts total Memory in GB, I start by running the command (NOTE – gm is an abbreviation for Get-Member)

Get-VMHost | gm

This produces the list below which allows you to see the attribute name for the Hosts total Memory in GB.

You will now be able to drill down and select this attribute

Get-VMHost | Select Name, MemoryTotalGB

This will give you a table displaying the Name of the host against its total Memory in GB’s

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.