#List-WMIValues.ps1 $class=Read-Host "Enter a Win32 WMI Class that you are interested in" $wmi=get-WMIObject -class $class -namespace "root\CimV2" $properties=$wmi | Get-Member -membertype Property Write-Host "Properties for $($Class.ToUpper())" -foregroundcolor yellow # if more than one instance was returned then $wmi will be an array # and we need to loop through it $i=0 if ($wmi.Count -ge 2) { do { foreach ($property in $properties) { #only display values that aren't null and don't display system #properties that start with __ if ($wmi[$i].($property.name) -ne $Null -AND ` $property.name -notlike "__*") { write-Host -foregroundcolor "Green" ` $property.name"="$wmi[$i].($property.name) } } #end foreach Write-Host "***********************************" #divider between instances $i++ }while($i -le ($wmi.count-1)) } #end if # else $wmi has only one instance else { foreach ($property in $properties) { if ($wmi.($property.name) -ne $Null -AND ` $property.name -notlike "__*") { write-Host -foregroundcolor "Green" ` $property.name"="$wmi.($property.name) } #end if } #end foreach } #end else