Understanding SELECT, WHERE, and FROM

The SELECT, WHERE, and FROM keywords are used with the Query parameter.

The generalized syntax for the Query parameter is as follows:

SELECT <Properties> FROM <WMI Class> 
SELECT <Properties> FROM <WMI Class> WHERE <Condition> 

The wildcard, *, may be used to request all available properties or a list of known properties may be requested:

Get-CimInstance -Query "SELECT * FROM Win32_Process" 
Get-CimInstance -Query "SELECT ProcessID, CommandLine FROM Win32_Process" 

The WHERE keyword is used to filter results returned by SELECT; for example, see the following:

Get-CimInstance -Query "SELECT * FROM Win32_Process WHERE ProcessID=$PID" 
WQL and arrays
WQL cannot filter array-based properties (for example, the capabilities property of Win32_DiskDrive).
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.129.19