Print from Powershell

x2i

Dan Wheeler

Posted on June 5, 2023

Print from Powershell

Run this in Powershell - substituting the <NAMEOFPRINTER> with the name of a printer installed on your machine (or remove it entirely to use default printer):

'Hello World' | Out-Printer '<NAMEOFPRINTER>'
Enter fullscreen mode Exit fullscreen mode

To print a specific file, it's:

Get-Content 'C:\MyNote.txt' | Out-Printer '<NAMEOFPRINTER>'
Enter fullscreen mode Exit fullscreen mode

Can also be used within PSEXEC to send prints from remote computers - obviously you'll need to specify the name of a printer which is actually installed on that computer.

💖 💪 🙅 🚩
x2i
Dan Wheeler

Posted on June 5, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Print from Powershell
powershell Print from Powershell

June 5, 2023