October 2017
Intermediate to advanced
440 pages
11h 47m
English
Redirecting output to null is a technique used to drop unwanted output. The variable $null takes the place of the filename:
Get-Process > $null
The preceding example redirects standard output (stream 1), to nothing. This is equivalent to using an empty filename:
Get-Process > ''
The stream number or * may be included to the left of the redirect operator. For example, warnings and errors might be redirected to null:
.\somecommand.exe 2> $null 3> $null .\somecommand.exe *> $null
Read now
Unlock full access