CmdID

CmdID / PowerShell / Cmdlets / Out

Out-Printer

Sends output to a printer. PowerShell reference

From the PowerShell reference 2 parameters Alias lp

Opens CmdID with your command, read as PowerShell. It is read in your browser and sent nowhere.

What it does

from the PowerShell reference, CC BY 4.0

Sends output to a printer. The Out-Printer cmdlet sends output to the default printer or to an alternate printer, if one is specified. Since the cmdlet doesn't have any way to configure the print job, the resulting print job uses the default settings defined for the printer. NOTE: This cmdlet was reintroduced in PowerShell 7. This cmdlet is only available on Windows systems that support the Windows Desktop.

Out-Printer [[-Name] <String>] [-InputObject <PSObject>] [<CommonParameters>]

Example 1 - Send a file to be printed on the default printer

Get-Content -Path ./readme.txt | Out-PrinterIdentify

Print a string to a remote printer

"Hello, World" | Out-Printer -Name "\\Server01\Prt-6B Color"Identify

Example 3 - Print a help topic to the default printer

$H = Get-Help -Full Get-CimInstance Out-Printer -InputObject $HIdentify

Its page in the reference: Out-Printer.

Parameters

2 in the PowerShell reference
-InputObjectSpecifies the objects to be sent to the printer. Enter a variable that contains the objects, or type a command or expression that gets the objects.
-NameSends the output to the specified printer. The parameter name Name is optional.