- Windows Server 2016 Automation with PowerShell Cookbook(Second Edition)
- Thomas Lee
- 90字
- 2021-07-02 18:15:59
How it works...
In step 1, you use Get-CimInstance to return all the printers defined on this system. In step 2, you display the total printers defined:
In step 3, you get the printer object corresponding to the Sales Group LaserJet printer. In step 4, you display the details of this printer:
In step 5, you invoke the PrintTestPage method on the Sales Group LaserJet printer, which then generates a test page on the printer. If you are using the printer MMC snap-in, the printer test page looks like this: