Getting Fromat of Hashtable a cmdlet supports

Hi All,

Recently I came to know that we can even use FormatString as hashtable key to format data as below.

Get-Process | ft Name,ID,@{name=‘VM’; exp={$_.VM/1MB};formatstring=‘N2’}

The thing is I never knew this, even I read help for Format-Table, but it is not documented there.

So my question is there a way I can find out what format of hastable a cmdlet supports, can I discover it by some code?

Thanks in Advance!!!

You can find documentation about it in the help section on the Format-Table commandlet. If you do:

Get-Help Format-Table -Parameter Property

You will be presented with the following information, which mentions the possible options for the hashtable keys:

-Property <Object[]>
    Specifies the object properties that appear in the display and the order in which they appear. Type one or more pro
    perty names (separated by commas), or use a hash table to display a calculated property. Wildcards are permitted.

    If you omit this parameter, the properties that appear in the display depend on the object being displayed. The par
    ameter name ("Property") is optional. You cannot use the Property and View parameters in the same command.

    The value of the Property parameter can be a new calculated property. To create a calculated, property, use a hash
    table. Valid keys are:

    -- Name (or Label) <string>

    -- Expression <string> or <script block>

    -- FormatString <string>

    -- Width <int32>

    -- Alignment  (value can be "Left", "Center", or "Right")

    Required?                    false
    Position?                    1
    Default value
    Accept pipeline input?       false
    Accept wildcard characters?  true

Thank you Robert …

It seems i need to give attention to property help.

You could also do

Get-Help Format-Table -Full

to get all the help sections about a cmdlet. That’s how I found it now.