Select Page

Required Files: None

Print a test page to the default printer.


#Printer Test page script for Nick
# Get Printer Objects for this computer from WMI
$printers = Get-WmiObject -Query " SELECT * FROM Win32_Printer WHERE Default=$true"
# Display printers
"{0} Printers defined on this system" -f $printers.count
foreach ($printer in $printers) {
"Printing test page for printer: {0}" -f $
# avoid issue with XPS Printers
if ($printer.DriverName -match "XPS" -or $printer.DriverName -match "SnagIt")  {
"Not printing a test page for this printer"
else {
$Result = $printer.PrintTestPage()
"Result                        : {0}" -f $Result.ReturnValue
# End of script