Printing a test page
There are occasions when you may wish to print a test page on a printer; for example, after changing the toner or printer ink on a physical printer or after changing the print driver (as shown in the Changing printer drivers recipe). In those cases, the test page helps you to ensure that the printer is working properly.
Getting ready
This recipe uses the PSRV
print server that you set up in the Installing and sharing
printers recipe.
How to do it...
- Getting the printer objects from WMI
$Printers = Get-CimInstance -ClassName Win32_Printer
- Displaying the number of printers defined on
PSRV
'{0} Printers defined on this system' -f $Printers.Count
- Getting the Sales group printer WMI object
$Printer = $Printers | &...