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.

WindowsprintingclipowershellLow risk
Pipe the file content to Out-Printer and pass the printer name with -Name (omit it to use the default printer).

01Command

Command
$ 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

RiskLow risk

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-09-17 · Category: Media

06Related solutions