CmdID / PowerShell / Cmdlets / Out
Out-Printer
Sends output to a printer. PowerShell reference
From the PowerShell reference
2 parameters
Alias lp
What it does
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-PrinterIdentifyPrint a string to a remote printer
"Hello, World" | Out-Printer -Name "\\Server01\Prt-6B Color"IdentifyExample 3 - Print a help topic to the default printer
$H = Get-Help -Full Get-CimInstance
Out-Printer -InputObject $HIdentifyIts page in the reference: Out-Printer.
Parameters
-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.