I have a PowerShell script that uses du.exe (Disk Usage originally from Sysinternals) to calculate the size of directories.
If I run du c:\\Backup
in th
I've recently been facing the same issues, but I would like to get the stderr output directed to stdout. You would think that the following would work:
& du 2>&1
But PowerShell will interpret the redirection and process it after 'du' is completed. The work-around I found is to invoke it using cmd.exe /c:
& cmd /c 'du 2>&1'