Powershell Core 6.2 Cookbook
上QQ阅读APP看书,第一时间看更新

How it works...

Stream redirection works very differently compared to the Variable parameters you saw in the previous recipe. Redirection, as it's implemented in many operating systems, will redirect an entire stream such as Error to either a file or to the output stream. There's hardly a productive use for this apart from applications feeding the wrong streams.

As you have seen in Step 4, the usage of stream redirection to other streams should be used with care. The output of the Get-Module cmdlet has been polluted with an error record. This is a completely different data type and will certainly get in your way.