How to list all properties of a PowerShell object

后端 未结 5 924
春和景丽
春和景丽 2020-12-04 07:47

When I look at the Win32_ComputerSystem class, it shows loads of properties like Status, PowerManagementCapabilities, etc. However, when in PowerSh

5条回答
  •  醉酒成梦
    2020-12-04 08:09

    I like

     Get-WmiObject Win32_computersystem | format-custom *
    

    That seems to expand everything.

    There's also a show-object command in the PowerShellCookbook module that does it in a GUI. Jeffrey Snover, the PowerShell creator, uses it in his unplugged videos (recommended).

    Although most often I use

    Get-WmiObject Win32_computersystem | fl *
    

    It avoids the .format.ps1xml file that defines a table or list view for the object type, if there are any. The format file may even define column headers that don't match any property names.

提交回复
热议问题