alias getmethod {
.comopen getmethod MSScriptControl.ScriptControl
if (!$comerr) {
var -s %v $&
strComputer = "." $lf $&
strNameSpace = "root\cimv2" $lf $&
strClass = $qt($1) $lf $&
Set objClass = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\" & strNameSpace & ":" & strClass) $lf $&
For Each objClassProperty In objClass.Properties_ $lf $&
result = result & objClassProperty.Name & " " $lf $&
Next
noop $com(getmethod,Language,4,bstr,VBScript)
if (!$comerr) noop $com(getmethod,ExecuteStatement,1,bstr,%v)
if (!$comerr) noop $com(getmethod,eval,3,bstr*,result)
if (!$comerr) {
tokenize 1 $com(getmethod).result
.comclose getmethod
return $1
}
}
:error
if ($error) reseterror
if ($com(getmethod)) .comclose getmethod
}