Hi,
I have some tasks that take hours to run. Using WSH I'm able to run the
task in silent mode (scheduled task) sending the output to StdOut.txt
and status messages to StdErr.txt, I can open either of these files for
Reading, even while the task is still running (e.g. from a web server).
d:\scripts\myscript.wsf 1>StdOut.txt 2>StdErr.txt
With PowerShell, I've run into two problems with this. I've been able to
separate the output from the status messages by sending the output to
the pipeline, and using write-host for the status messages, I can then
redirect the pipline output to StdOut.txt
..\PsTest.ps1 > StdOut.txt
but the status messages always go to the screen (which no one can see!).
So my question is how can I redirect the status messages AND the output
to two different files?
The second issue is that under PowerShell, I am not able to open the log
files for reading while the PowerShell process is still running "File
locked by another process".
--
Gerry Hickman (London UK)