PowerShell - Outptut Stream

Windows Powershell Menu

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





Discover More
Windows Powershell Menu
PowerShell - Variable

A variable in Powershell is an object. It has then member (of properties) See the member of a variable List the functions to manipulate a variable A variable full scope name is expressed...



Share this page:
Follow us:
Task Runner