I have a process & some action I want to monitor the run log and "capture" the error messages. I tried to define a variable that "catches" the log $var=& some action the problem is that it stores all the log without the errors (the red lines). Using Start-Process is not an option.
1 Answer
A while ago, I created a Log-Entry framework described here: https://stackoverflow.com/a/41861276/1701026.
In here I deal with this issue by checking the Error object for new errors (described here: https://stackoverflow.com/a/44441600/1701026) each time a new entry is logged.