Bring back Out-Printer
See original GitHub issueSummary of the new feature/enhancement
‘As a user I want to be able to send output of a command to a printer.’
For example Get-Process | out-printer "OneNote"
would save the current processes to a new page in OneNote
or Get-Package | lp
Would send a list packages to the default printer
Proposed technical implementation details
Windows PowerShell has an Out-Printer
command with an alias of lp
.
but this was dropped in PowerShell core V6
I have posted a version for V6 and later at https://www.powershellgallery.com/packages/6print with a repo at https://github.com/jhoneill/6Print
This provides some additional controls over the output. I’d propose this as a first draft / worked example of how it could be done.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:8
Top Results From Across the Web
Putting Out-Printer back into PowerShell 6.1
So I thought I would try to put it back. The result is named 6Print and you can install it from the PowerShell...
Read more >Out-Printer - PowerShell
Out-Printer. Send output to a printer. Syntax Out-Printer [[-name] string] [-inputObject psobject] [CommonParameters] Key -name string The printer name, ...
Read more >Out-printer cmdlet | Greg's Blog - WordPress.com
To print a word or pdf document you need to use this command. Start-Process -FilePath “C:\Test.Docx” -Verb Print. Which brings you back to...
Read more >Old pushed out printer issue : r/sysadmin
I've checked group policy and anything to do with pushing out these printers is gone. The old DC02 server is long gone and...
Read more >Out-Printer (Microsoft.PowerShell.Utility)
The Out-Printer cmdlet sends output to the default printer or to an alternate ... Get-Content gets the contents of the readme.txt file in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@iSazonov Yes. Completely agree, cmdlets should work on all supported OSes, but this a should, not a must. We already have a Printer Management module which manages printer drivers, settings, queues and jobs (and it might make sense to out Out-Printer to this module). But this module only understands Windows print-devices, print-queues and print-jobs; Unix-based OSes have their own command line tools for managing these, Windows didn’t have until PowerShell added them (and the “Print” command which has been around since DOS, is still in CMD but only sends a printer ready file to a port name like “PRN” or “LPT2” so is effectively “broken”) .
command | lp
and send Output to the printer.lp
so you can docommand | lp
and send Output to the printer.command | lp
doesn’t work is on PowerShell core when running on Windows.The idea is to plug that gap. Having something missing from some OSes is undesirable, but having something which was in Windows PowerShell 5 missing in 7 is probably worse - especially as any linux shell, including pwsh can print using
| lp
, which is their solution until the .NET portable subset gets printing support.🎉This issue was addressed in #10906, which has now been successfully released as
v7.0.0-preview.6
.🎉Handy links: