| external help file | Microsoft.PowerShell.Commands.Utility.dll-Help.xml | |
|---|---|---|
| Locale | en-US | |
| Module Name | Microsoft.PowerShell.Utility | |
| ms.date | 12/12/2022 | |
| online version | https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/out-printer?view=powershell-7.6&WT.mc_id=ps-gethelp | |
| schema | 2.0.0 | |
| aliases |
|
|
| title | Out-Printer |
Sends output to a printer.
Out-Printer [[-Name] <String>] [-InputObject <PSObject>] [<CommonParameters>]
This cmdlet is only available on the Windows platform.
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.
This example shows how to print a file, even though Out-Printer does not have a Path
parameter.
Get-Content -Path ./readme.txt | Out-PrinterGet-Contentgets the contents of the readme.txt file in the current directory and pipes it to
Out-Printer, which sends it to the default printer.
This example prints Hello, World to the Prt-6B Color printer on Server01.
"Hello, World" | Out-Printer -Name "\\Server01\Prt-6B Color"The Name parameter selects a specific printer, rather than the default.
This example prints the full version of the Help topic for Get-CimInstance.
$H = Get-Help -Full Get-CimInstance
Out-Printer -InputObject $HGet-Help gets the full version of the Help topic for Get-CimInstance and stores it in the $H
variable. The InputObject parameter passes the value of $H to Out-Printer.
Specifies 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.
Type: System.Management.Automation.PSObject
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: FalseSends the output to the specified printer. The parameter name Name is optional.
Type: System.String
Parameter Sets: (All)
Aliases: PrinterName
Required: False
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
You can pipe any object to this cmdlet.
This cmdlet returns no output.
This cmdlet is only available on Windows platforms.
The cmdlets that contain the Out verb do not format objects. They just render them and send them
to the specified display destination. If you send an unformatted object to an Out cmdlet, the
cmdlet sends it to a formatting cmdlet before rendering it.
Out-Printer sends data to the printer, but does not emit any output objects to the pipeline. If
you pipe the output of Out-Printer to Get-Member, Get-Member reports that no objects have been
specified.