May 2007
Beginner
320 pages
8h 23m
English
In this exercise, we will explore the use of WMI to obtain information about printers defined on your machine. As we do this, we will examine the use of several Windows PowerShell cmdlets that can dramatically simplify the use of WMI in our scripting.
Start Windows PowerShell by using Start | Run | PowerShell.
Open Notepad.exe or your favorite script editor.
Open the WmiTemplate.ps1 file from the scripts folder for this chapter and save it as yournameWorkingWithPrinters.ps1. Refer to the WorkingWithPrinters.ps1 script already in this chapter's script folder to see a sample of a completed solution to this exercise.
Modify the $wmiQuery line to query the WIN32_Printer class. The revised line is shown here:
$wmiQuery ...
Read now
Unlock full access