View printer properties and print test page

View printer properties and print a test page powershell

The Powershell solves every concern again. We read out all installed printers via the WMI and display and display the properties of a defined printer. Name, share name and status of the printer.

# Retrieve printer objects via WMI:
$ Printers = Get-CimInstance -ClassName Win32_Printer

# How many printers are set up on the system
'{0} printer defined on this machine' -f $ Printers.Count

# Load printer properties via the WMI object:
$ Printer = $ Printers |
Where-Object Name -eq 'HP Color Laser MFP 178 179'

# View the details of the HP Color Laser MFP 178 179 printer:
$ Printer | Format-Table -AutoSize

# Test page: print
Invoke-CimMethod -InputObject $ Printer -MethodName PrintTestPage

View printer properties and print test page