Table of Contents

PowerShell - Outptut Stream

About

IO - Standard streams (stdin, stdout, stderr)

Type

Standard

Write-Host "Hello`r`n"
Write-Host "Nico`r`n"
Write-Host "DSN : $($DSN)"
Write-Host "DSN Name : $($DSN.Name)"
# in a pipeline
%{ ("","DSN Attribute of: $($_.Name)")}

Error

[Console]::ForegroundColor = 'red'
[Console]::Error.WriteLine($message)
[Console]::ResetColor()

Redirect

What are Shell Redirections? of Standard Streams Doc

# Discard errors
2>$null
# Redirect all output streams (Then all objects also, no return values !)
*>$null