How to redirect stdout and stderr to file and console separately in PowerShell?
Go through all the sites, I find basically there are two method, but NEITHER can fully satisfy the requirement
& .\test.ps1 2>&1 | tee .\out.txt
In this case , stdout and stderr can still be shown on console, but they will be combined in the same file
& .\test.ps1 2>error.txt | tee out.txt
This is the workaround I saw from SilverNak. However as he said, stderr will not be shown on console