Finding True WMI Properties

by Jul 16, 2012

When you use Get-WmiObject to retrieve WMI objects, PowerShell adds a number of supporting properties. If you want to display only the native WMI properties, you first need to sort out the additional property names and then exclude them.

This would get you all BIOS information including the PowerShell-added properties:

PS> Get-WmiObject Win32_BIOS | Select-Object * | Out-GridView

And this approach—although a bit lengthy—limits output to only the true WMI properties:

$WMIObj = Get-WmiObject -Class Win32_BIOS

$props = $WMIObj | 
  Get-Member -MemberType Property | 
  Select-Object -ExpandProperty Name | 
  Where-Object { !$_.StartsWith('__') }

$WMIObj | Select-Object -Property $props | Out-GridView

Twitter This Tip! ReTweet this Tip!