October 2017
Intermediate to advanced
440 pages
11h 47m
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). PowerShell also has Write-Host, which displays information to the PowerShell host (the console, or PowerShell ISE). Each of these has a stream of its own.
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 Win32_ComputerSystem -Verbose$stdoutVERBOSE: Perform operation 'Enumerate CimInstances' with following parameters, ''namespaceName' = root\cimv2,'className' = Win32_ComputerSystem'. ...
Read now
Unlock full access