Working with software: step-by-step exercises

In the first exercise, you will explore the use of WIN32_product and classes provided by the Windows installer provider. In the second exercise, you will work with the environment provider.

Using WMI to find installed software

  1. Open the Windows PowerShell ISE or your favorite script editor.

  2. At the top of your script, declare a variable called $strComputer. Assign the WMI shortcut dot character (.) to indicate you want to connect to WMI on your local machine. This line of code is shown here:

    $strComputer = "."
  3. On the next line, declare the variable $wmiNS, which will be used to hold the WMI namespace for your query. Assign the string Root\cimv2 to the variable. This line of code is shown here:

    $wmiNS ...

Get Windows PowerShell™ 3.0 Step by Step now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.