Table of Contents

About

IO - Standard streams (stdin, stdout, stderr)

Type

Standard

  • Using carriage return
Write-Host "Hello`r`n"
Write-Host "Nico`r`n"
  • Variabe and properties
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
# Discard errors
2>$null
# Redirect all output streams (Then all objects also, no return values !)
*>$null