Tip: You can send the output to a printer by using the cmdlet Out-Printer.
If the optional parameter “Name” is not specified, the default printer is used.
1 2 3 4 5 |
# Default printer Get-Content -Path 'C:\demo\document.txt' | Out-Printer # Specific printer Get-Content -Path 'C:\demo\document.txt' | Out-Printer -Name 'HP Deskjet 2540 series (Netzwerk)' |
An example with a PDF printer: