PowerShell: Print to Screen

By Xah Lee. Date: . Last updated: .

Print to Screen

Write-Host
print to screen. Useful for prompting user.

Print to Screen or Pipe

Write-Output (alias echo , write)
print to screen or sent it to the pipeline, if there is a pipe.

Command Output are Automatically Printed to Screen

Out-Host

send output to screen. Out-Host is automatically appended to every command that is executed.

Suppress Command Output

# suppress command output
mkdir dirName | Out-Null
# suppress command output. most efficient
$null = mkdir dirName

PowerShell: Input/Output


PowerShell in Depth

Path

Pipe

Comment

Value Types

String

Variable

Boolean

Conditional

Data Structure

Loop and Iteration

Input/Output

Function

Profile and Script

Script Examples

Misc