That does give me what I'm looking for, but so far only seems to work if my first input into the function is a string.
Ultimately I am trying to capture the output of some processes I kick off, but instead of sending the output to the console, I want to send it to a file, and have each line of that output timestamped.
Basically I'm trying to create a log of a script I've written that kicks off multiple exe's. I control what is sent to the console, but in the event that something doesn't work as expected, I am also creating a more verbose log file that also shows when certain processes are kicked off.
Right now it seems if I try to put a [System.Diagnostics.Process]::start($process) as the first argument after calling the WTL function, it never starts the process (but oddly the script doesn't error out either).
Is there a way to accomplish this?
Thanks for all of the help thus far. |