Tuesday, April 29, 2014

Powershell: How to enumerate through WMI Classes

$ns
function enumclasses
{
    $classnames = Get-WmiObject -namespace $ns -class Meta_Class | select name  
    foreach($cn in $classnames)
    {
            write-host $cn.Name  
    }        
}  

$ns = "root\cimv2"
enumclasses

No comments:

Post a Comment