Out-Host
Use Out-Host to send output to the host for display, optionally one screen at a time.
Documentation: Microsoft Learn — PowerShell module reference
Syntax
See the command anatomy
Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.
Out-Host [-Paging] [-InputObject <PSObject>] [<CommonParameters>]- Stage 1Out-Host
-Paging -InputObject
Try it
PowerShell example · browser support is limited.
Execution scope: The full example below requires PowerShell outside this browser. You can edit this runner to use the supported practice commands; unsupported syntax returns an explanation.
Follow the objects
Run the command to inspect each stage.
Examples
Select first 5
Show reference output
Sample output · fictional data, shaped like the real thing
Name Status -------- ------- BITS Running Dnscache Running Spooler Stopped WinRM Running
Get-Command -Paging
Show reference output
Sample output · fictional data, shaped like the real thing
CommandType Name Version Source ----------- ------------- ------- ------------------------------- Cmdlet Get-Process 7.5.2 Microsoft.PowerShell.Management Cmdlet Get-Service 7.5.2 Microsoft.PowerShell.Management Cmdlet Get-ChildItem 7.5.2 Microsoft.PowerShell.Management
Select first 3
Show reference output
Sample output · fictional data, shaped like the real thing
Name Id ------ ----- chrome 9184 Code 6620 pwsh 11268
Parameters
Parameter definitions:
-Paging-InputObject
Practical use and troubleshooting
Practical scenario: Use Out-Host when you need to send output to the host for display, optionally one screen at a time. Review syntax and sample output, then try an example in the browser lab. Start with one identified target and inspect the returned values before extending the operation to a list. Keep the identity in your report so you can trace each result back to the object or path that produced it.
Common error and fix: A variable receiving no result can be expected after Out-Host consumes the input for display. Return the objects separately and use host display only at the presentation boundary. In an unattended script, capture this failure with its original error record and record which target failed. An empty result and an unsuccessful query must remain distinguishable in the final report.
See also: Write-Output. Out-Host sends output to the host display; Write-Output sends it along the success pipeline. Sending a result to the host prevents ordinary downstream object processing. Read the linked command before substituting it; similar names do not imply identical inputs or output.
Recap
Out-Host Use Out-Host to send output to the host for display, optionally one screen at a time.
Next: Test-NetConnection