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