title: PowerShell log output of function
body: <p>I am using dbatools to run some updates. It returns detailed results to the console. I would like to write this to a log file</p>
  <pre><code>  Import-DbaCsv -Path $_.FullName -SqlInstance $server -Database $DataBase -Table tempdata -schema dev -Delimiter &quot;|&quot;
  </code></pre>
  <p>I am using PSFramework /Write-PSFMessage but I am not sure how I can capture the output from this and log it.</p>