title: Couldn't find "Microsoft.SqlServer.BatchParser.dll" when executing a Powershell script through MSBuild
body: <p>We have a MSBuild process that currently executes a set of scripts, one of which is a Powershell script that uses some of the SMO tools inside powershell. If I copy and paste the line that MSBuild prints into command prompt, it works perfectly, however whenever MSBuild runs it can't find the assembly.</p>
  
  <p>I have printed environment variables, they are the same so I am assuming it's a property in the <code>.targets</code> however for the life of me I can't find a way to print the variable it's scanning for or know where it would be.</p>
  
  <pre><code>Could not load file or assembly 'Microsoft.SqlServer.BatchParser, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.]
  </code></pre>
  
  <p>Any ideas or solutions to help, I am stumped?</p>