Print a File from the Command Line with Out-Printer
The forgotten Out-Printer cmdlet pipes any PowerShell output or text file directly to an installed printer.
01Command
$ Get-Content C:\reports\summary.txt | Out-Printer -Name 'Microsoft Print to PDF'02What it does
Out-Printer has existed since PowerShell v2 but almost nobody remembers it. It renders plain text into printer pages, which also makes it a free text-to-PDF converter via the 'Microsoft Print to PDF' printer every Windows has. For richer formats, Start-Process file.docx -Verb Print hands the document to its associated app instead.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- Out-Printer (Microsoft.PowerShell.Utility)Evidence: Documents Out-Printer sending output to a printer, with -Name selecting a specific installed printer.
Last verified: 2026-09-17 · Category: Media
06Related solutions
Search inside text files and logs with regex, returning file, line number and match.
Create or update a .zip from any files or folder contents straight from PowerShell.
A built-in PowerShell one-liner that answers 'is port 5432/3389/443 actually open through this network?' — no telnet client needed.