PowerShell for Windows Admins

Mar 21 2011   1:15PM GMT

Documenting WMI



Posted by: Richard Siddaway
PowerShell v2, WMI

Its been said many times that tracking down documentation on WMI classes can be difficult. This script will help to some degree

001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
function get-wmidoc {
param
 (
 
[string]$class
)

$data = Get-WmiObject -List $class -Amended 

"Methods"
$data | select -ExpandProperty methods

"Properties"
$data | select -ExpandProperty properties

"Qualifiers"
$data | select -ExpandProperty qualifiers

}

Take a WMI class name as a parameter (assumes that using root\cimv2 namespace but could add namespace as another parameter) then get the amended listing.  The methods, properties and qualifiers can be displayed.

Comment on this Post

Leave a comment: