How to list all properties of a PowerShell object

When I look at the Win32_ComputerSystem class , it shows a lot of properties like Status , PowerManagementCapabilities , etc. However, when PowerShell I do below, I will only return 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 the properties?

+102
powershell
Aug 31 2018-11-18T00:
source share
5 answers

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 the format of a table or list. They are usually intended to limit the display of multiple properties down to only the basic properties. However, there are times when you really want to see everything. In these cases, Format-List * will show all the properties. Please note that in case you are trying to view the PowerShell error record, you need to use "Format-List * -Force" to really see all the error information, for example,

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

Note that the wildcard can be used as a traditional pattern:

 Get-WmiObject -Class "Win32_computersystem" | Format-List M* 
+112
Aug 31 2018-11-11T00:
source share

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

 Get-WmiObject -Class "Win32_computersystem" | Get-Member 
+29
Aug 31 '11 at 3:23 a.m.
source share

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.

+24
Mar 28 '14 at 15:30
source share

I like

  Get-WmiObject Win32_computersystem | format-custom * 

This seems to expand everything.

The PowerShellCookbook module also has a show-object command that does this in the GUI. Jeffrey Sverver, creator of PowerShell, uses it in his unconnected videos (recommended).

Although most often I use

 Get-WmiObject Win32_computersystem | fl * 

It avoids the .format.ps1xml file, which defines the presentation of the table or list for the type of object, if any. A format file can even specify column headers that do not match any property names.

+4
May 04 '17 at 17:29
source share

The shortest way to do this is:

 Get-WmiObject -Class win32_computersystem -Property * 
+3
Jun 29 '17 at 22:25
source share



All Articles