FG

PowerShell and Tee

Fresh3 days ago
Mar 15, 202610825 views
Confidence Score0%
0%

Problem

I use this command to see output both in the console and a file: It works not as good as I expected and I have some questions: How do I redirect stderr also to a file? The output works very strange. For some commands there is a huge delay between text is printed and console/file is updated. For som…

Error Output

powershell -command "my_command_1 | tee ('logs\{0}.log' -f (Get-Date -format 'yyyy.MM.dd-HH.mm'))"  
powershell -command "my_command_2 | tee ('logs\{…

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: PowerShell and Tee

Low Risk

. See . You should be trapping errors, not relying on Ctrl+C. See . Is the command you're running an external program or a script? As I understand it, typically string objects are not sent down the pipe until an end-of-line character is reached. The…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment