When handling file redirection for CommandExpression, we don't call 'DoComplete' on the underlying PipelineProcessor of the FileRedirection object, and thus the EndProcessing method is not called on Out-File, which causes different behaviors between <expr> > out.txt and <expr> | Out-File out.txt. The fix is to make sure 'DoComplete' is called after the stream output has been written to the redirection pipe. Also fix another issue This PR also fixes an issue that could mess up restoring the original pipes. Here is the repro: PS> 1 *> b.txt > a.txt; 123 Cannot perform operation because object "PipelineProcessor" has already been disposed The root cause is that we don't always restore pipes in the correct order. Please see the code changes in Compiler.cs for more details. Fix #4812 |
||
---|---|---|
.. | ||
common/markdown | ||
csharp | ||
docker/networktest | ||
powershell | ||
PSReadLine | ||
shebang | ||
tools | ||
README.md | ||
Test.Common.props |
Testing
The tests are organized by testing language. Thus Pester tests, which are written in the PowerShell language, are in ./powershell and xUnit tests, written in C#, are in ./csharp. The sanity tests for the Full .NET build of PowerShell are in ./fullclr, and the third-party shebang test is in ./shebang.