140

When I look at the Win32_ComputerSystem class, it shows loads of properties like Status, PowerManagementCapabilities, etc. However, when in PowerShell I do the below I only get back a couple:

PS C:\Windows\System32\drivers> Get-WmiObject -Class "Win32_computersystem"

Domain              : YYY.com
Manufacturer        : VMware, Inc.
Model               : VMware Virtual Platform
Name                : LONINEGFQEF58
PrimaryOwnerName    : Authorised User
TotalPhysicalMemory : 2147016704

How can I see all properties?

David Gardiner
  • 16,892
  • 20
  • 80
  • 117
lara400
  • 4,646
  • 13
  • 46
  • 66

6 Answers6

163

Try this:

Get-WmiObject -Class "Win32_computersystem" | Format-List *
Get-WmiObject -Class "Win32_computersystem" | Format-List -Property *

For certain objects, PowerShell provides a set of formatting instructions that can affect either the table or list formats. These are usually meant to limit the display of reams of properties down to just the essential properties. However there are times when you really want to see everything. In those cases Format-List * will show all the properties. Note that in the case where you're trying to view a PowerShell error record, you need to use "Format-List * -Force" to truly see all the error information, for example,

$error[0] | Format-List * -force

Note that the wildcard can be used like a traditional wilcard this:

Get-WmiObject -Class "Win32_computersystem" | Format-List M*
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Keith Hill
  • 194,368
  • 42
  • 353
  • 369
48

If you want to know what properties (and methods) there are:

Get-WmiObject -Class "Win32_computersystem" | Get-Member
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
manojlds
  • 290,304
  • 63
  • 469
  • 417
  • 10
    I am not going to mark you down because of the wording of the original question. But it is worth pointing out that Get-Member does not list the properties and their values only the property/method names and types. – rob Jan 15 '14 at 12:03
  • 1
    This is very useful when scripting to know the type of data each field contains and to list all available field names without fetching data. Thanks! – Yanick Girouard Oct 18 '19 at 13:25
41

You can also use:

Get-WmiObject -Class "Win32_computersystem" | Select *

This will show the same result as Format-List * used in the other answers here.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Rikels
  • 546
  • 4
  • 5
  • 6
    This is actually better than the method in the accepted answer, since using this method you still have rich objects, whereas using `Format-List` will destroy all of the objects down the pipeline. – Jessie Westlake Mar 13 '17 at 01:47
12

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.

js2010
  • 23,033
  • 6
  • 64
  • 66
4

The most succinct way to do this is:

Get-WmiObject -Class win32_computersystem -Property *
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Kellen Stuart
  • 7,775
  • 7
  • 59
  • 82
  • 4
    Succinct, perhaps, but incomplete. This only lists the originally seen (5) properties vs the 83 that show up when using: Get-WmiObject -Class "Win32_computersystem" | Select * – boB Nov 05 '19 at 00:44
1

You can list all properties of object using Four ways

Method-1: Format-Table

Get-Process | Format-Table -Property * -Wrap | Out-File abc.txt -Width 5000
OR
Get-Process | Format-Table * -Wrap | Out-File abc.txt -Width 5000
OR
Get-Process | FT * -Wrap | Out-File abc.txt -Width 5000

Method-2: Format-List

Get-Process | Format-List -Property *
OR
Get-Process | Format-List *
OR
Get-Process | FL *

Method-3: ConvertTo-Html

Get-Process | ConvertTo-Html | Out-File services1.html ; invoke-item services1.html

Method-4: Out-GridView

Get-Process | Select * | Out-GridView

Comparision of results to show parameters usage:

  • Format-Table/Format-List If you want to include all columns then always use -Property * parameter

  • Format-Table always capture output to a file using Out-File because sometime not all columns are included if you show result on screen.

  • FormatTable always specify reasonable width using -Width parameter otherwise column values are truncated in result.

enter image description here

  • Format-Table always use -Wrap so that column with large text is not trimmed but is shown in multiple line in long column.

enter image description here

  • CovertTo-Html properties with collections will only display Type Name of Collection insted of comma seperated values of collection items. This display is bit different from how Format-Table, Format-List & ConvertTo-Html display property with collection

enter image description here

Hemendr
  • 673
  • 6
  • 12
  • using `Out-GridView` to format output of commands like `Get-WmiObject Win32_OperatingSystem` could be more user-friendly, if there was a way to transpose the table, so it lists all properties vertically instead of presenting the object as a extremely wide table – AntonK Mar 03 '23 at 08:57