title: SQL Server 2008: how to get the "Messages" tab (in Management Studio) output with powershell
body: <p>I am using <code>invoke-sqlcmd</code> to manage my databases, it works fine.
  I save the output of the "Results" tab in Management Studio to a log file.</p>
  
  <p>When I do a <code>BACKUP DATABASE</code>, the output is done on the "Messages" tab and I would like to save it in the logfile.</p>
  
  <p>Is there a way to get that output ? (or a table in SQL Server 2008 that stores the backup progression and results ?)</p>
  
  <p>The SQL Server 2008 logs contain something but it is not as verbose as the "Messages" tab.</p>