2026-07-08 16:22:34 -06:00
|
|
|
# Out-Host
|
|
|
|
|
|
|
|
|
|
> Handle and output `stdout` of any command within PowerShell session.
|
|
|
|
|
> Can also be used as a substitute of `more`.
|
|
|
|
|
> Note: This command can only be used through PowerShell.
|
|
|
|
|
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.core/out-host>.
|
|
|
|
|
|
|
|
|
|
- Display a command output or variable's value into the command-line (equivalent to invoking the command or variable without `Out-Host` itself):
|
|
|
|
|
|
|
|
|
|
`{{command_or_variable}} | Out-Host`
|
|
|
|
|
|
|
|
|
|
- Display the output into an interactive paging view (will not work in PowerShell ISE):
|
|
|
|
|
|
|
|
|
|
`{{command_or_variable}} | Out-Host -Paging`
|
|
|
|
|
|
2026-08-06 22:19:46 -06:00
|
|
|
- Interactively display a text file within the paging view (equivalent to `more path/to/file`):
|
2026-07-08 16:22:34 -06:00
|
|
|
|
|
|
|
|
`Get-Content {{path\to\file}} | Out-Host -Paging`
|
|
|
|
|
|
|
|
|
|
- Go to the next page within the paging view:
|
|
|
|
|
|
|
|
|
|
`<Space>`
|
|
|
|
|
|
|
|
|
|
- Go to the next line within the paging view:
|
|
|
|
|
|
|
|
|
|
`<Enter>`
|
|
|
|
|
|
|
|
|
|
- Exit the paging view:
|
|
|
|
|
|
|
|
|
|
`<q>`
|