Out-Host - PowerShell command help and examples

Sends output to the command line. (Out-Host)


NAME
Out-Host
SYNOPSIS
Sends output to the command line.
SYNTAX
Out-Host [-InputObject <psobject>] [-Paging] [<CommonParameters>]
DESCRIPTION
The Out-Host cmdlet sends output to the Windows PowerShell host for display. The host displays the output at the command line. Because Out-Host is the default, you do not need to specify it unless you want to use its parameters to change the display.
PARAMETERS
-InputObject <psobject> Specifies the objects that are written to the console. Enter a variable that contains the objects, or type a command or expression that gets the objects. Required? false Position? named Default value Accept pipeline input? true (ByValue) Accept wildcard characters? false -Paging [<SwitchParameter>] Displays one page of output at a time, and waits for user input before displaying the remaining pages, much like the traditional "more" command. By default, all of the output is displayed on a single page. The page size is determined by the characteristics of the host. Required? false Position? named Default value Accept pipeline input? false Accept wildcard characters? false <CommonParameters> This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer and OutVariable. For more information, type, "get-help about_commonparameters".
INPUTS
System.Management.Automation.PSObject You can pipe any object to Out-Host.
OUTPUTS
None Out-Host does not generate any output. However, the host might display the objects that Out-Host sends to it.
NOTES
You can also refer to Out-Host by its built-in alias, "oh". For more information, see about_Aliases. The cmdlets that contain the Out verb (the Out cmdlets) 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. The Out cmdlets do not have parameters for names or file paths. To send data to an Out cmdlet, use a pipeline operator (|) to send the output of a Windows PowerShell command to the cmdlet. You can also store data in a variable and use the InputObject parameter to pass the data to the cmdlet. For help, see the examples. Out-Host sends data, but it does not emit any output objects. If you pipe the output of Out-Host to Get-Member, Get-Member reports that no objects have been specified.

Examples

EXAMPLE 1
C:\PS>get-process | out-host -paging
Description
----------- This command displays the processes on the system one page at a time. It uses the Get-Process command to get the processes on the system. The pipeline operator (|) sends the results to Out-Host, which displays them at the console. The Paging parameter displays one page of data at a time. The same command format is used for the Help function that is built into Windows PowerShell. That function gets data from Get-Help and then uses the Paging parameter of Out-Host to display the data one page at a time by using this command format: get-help $args[0] | out-host -paging).
EXAMPLE 2
C:\PS>$a = get-history C:\PS>out-host -InputObject $a
Description
----------- These commands display the session history at the command line. The first command uses the Get-History cmdlet to get the session history, and then it stores the history in the $a variable. The second command uses Out-Host to display the content of the $a variable, and it uses the InputObject parameter to specify the variable to Out-Host. RELATED LINKS Online version: http://go.microsoft.com/fwlink/?LinkID=113365 Out-Printer Out-Null Out-File Out-String Out-Default Write-Host C:\Windows>powershell get-help Out-File -full

Microsoft Windows [Version 10.0.19045.3693]
Copyright (c) 2023 Microsoft Corporation.

ColorConsole [Version 3.7.1000] PowerShell 2.0-Export

Windows 11, 10, 8.1, 8, 7 / Server 2022, 2019, 2016











Windows-10


... Windows 10 FAQ
... Windows 10 How To


Windows 10 How To


... Windows 11 How To
... Windows 10 FAQ



PowerShell: Sends output to the command line.

HTTP: ... PS_Windows/en/Out-Host.htm
0.093
11529

Ich kann den Autostart Eintrag nicht finden auf Windows 10/11, wo ist er?

Kann ich den Touch Screen unter Windows 11 kalibrieren!

Does the registration work with Win 11 even without an internet connection!

Printer problems after upgrading under Windows, what did I do wrong?

What is the file time, or the folder time?

Difference between key combination and keyboard shortcuts?



(0)