I'm currently struggling trying to figure out how to use the -query
parameter with gwmi for namespaces other than "root\cimv2".
It's simple enough to do something like:-
>$query = "SELECT * from Win32_Service WHERE name='W32Time'"
>gwmi -query $query
ExitCode : 0
Name : W32Time
ProcessId : 1688
StartMode : Auto
State : Running
Status : OK
but.. what if I want to get data out of "root\securitycenter" and the
I looked on MSDN for WQL but couldn't see any (to me) clear example of
what the syntax should be for such a gwmi statement.
Would appreciate any examples showing how best to construct the WQL to
reference the namespace and class.