February 2019
Intermediate to advanced
626 pages
15h 51m
English
In PowerShell there are other output streams; these include error (Write-Error), information (Write-Information, introduced in PowerShell 5), warning (Write-Warning), and verbose (Write-Verbose). Each of these has a stream of its own.
In PowerShell 5 and later, the Write-Host command sends output to the information stream.
Prior to PowerShell 5, Write-Host did not have a dedicated stream; the output could only be captured via a transcript, that is, using the Start-Transcript command to log console output to a file.
For example, if the Verbose switch is added to the preceding command, more information is shown. This extra information is not held in the variable, it is sent to a different stream:
PS> $stdout = Get-CimInstance ...
Read now
Unlock full access