Selective Data from All Instances

The next level of sophistication (from using Select *) is to return only the properties you are interested in. This is a more efficient strategy. For instance, in the previous example, you entered Select * and were returned a lot of data you weren't necessarily interested in. Suppose you want to know only what shares are on each machine.

Note

Just the Steps To select specific data

  1. Make a connection to WMI by using the Get-WmiObject cmdlet

  2. Use the query argument to supply the WMI query to the Get-WmiObject cmdlet

  3. In the query, use the Select statement to choose the specific property you are interested in, for example, Select name.

  4. In the query, use the From statement to indicate the class from which you want to retrieve ...

Get Microsoft® Windows PowerShell™ Step By Step now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.