I want to prepend a timestamp to each line of output from a command. For example:
foo
bar
baz
would become:
[2011-12-13 12:20:38] foo
[2011-12-13 12:21:32] bar
[2011-12-13 12:22:20] baz
where the time being prefixed is the time at which the line was printed. How can I achieve this with PowerShell?