Executive Summary:
| If you read the Windows PowerShell documentation for the Out-Printer cmdlet, you'll learn that to send output to a nondefault printer, you need to specify the printer's name. However, the documentation doesn't tell you how to find that name. Here are several ways you can obtain printer names and make them available to your PowerShell code with no copying and pasting and minimal typing. |
Windows PowerShell lets you send output to a printer with its Out-Printer cmdlet. However, the printer names that Out-Printer uses to identify printers aren’t immediately obvious and aren't directly available to you in PowerShell. So, I'll show you how to obtain the printer names you need to send output to both default and nondefault printers. If you'd like to try the code while you're reading this article, you'll find many of the inline commands, along with the code in the listings, in the Code_for_Out-Printer_Article.txt file. You can download this file by clicking the Download the Code Here button in the upper left corner of this page. . . .