Search notes:

WQL

WQL is the WMI Query Language.
There are three types of WQL queries:

PowerShell

In PowerShell, a WQL statement might be executed like so:
$result = get-wmiObject -computerName '.' -namespace 'root\cimv2' -query 'select caption, processId, sessionId, threadCount from win32_process'

forEach ($rec in $result) {
  "{0,5} {1,-20}: {2,1} {3,3}" -f $rec.processId, $rec.caption, $rec.sessionId, $rec.threadCount
}

Index