title: What is the invoke-sqlcmd verbose output to file syntax?
body: <p>I currently have:</p>
  
  <pre><code>(invoke-sqlcmd -inputfile (Join-Path $FileDirectory $FileName) -ServerInstance $ServerName -verbose) &gt; $OutFileName
  </code></pre>
  
  <p>To which I'm getting the output:</p>
  
  <pre><code>VERBOSE: Changed database context to 'BLUELABEL'
  </code></pre>
  
  <p>I'm trying to use the verbose output to write to the file designated by the Join-Path function.</p>
  
  <p>What am I doing wrong?</p>
  
  <p>(Using PowerShell V3)</p>
  
  <p>I did find this question with answers, but it seems different and I can't seem to apply the same ideas: <a href="https://stackoverflow.com/questions/4511498/powershell-invoke-sqlcmd-capture-verbose-output">Powershell Invoke-Sqlcmd capture verbose output </a></p>