February 2019
Intermediate to advanced
626 pages
15h 51m
English
Streams can be redirected to standard output in PowerShell. The destination stream is written on the right-hand side of the redirect operator (without a space). Stream numbers on the right-hand side are prefixed with an ampersand (&) to distinguish the stream from a filename.
For example, the Information output written by the following command is sent to standard output:
PS> function Test-Redirect{>> 'This is standard out'>> Write-Information 'This is information'>> }PS> $stdOut = Test-Redirect 6>&1PS> $stdOutThis is standard outThis is information
It is possible ...
Read now
Unlock full access