title: Powershell x86: Could not load file or assembly Microsoft.SqlServer.BatchParser
body: <p>When I try to do an <code>invoke-sql</code> command from Powershell X86 I get an error</p>
  
  <pre><code>invoke-sqlcmd -Query "SELECT 'HELLO!'" -ServerInstance Server -Database DB
  </code></pre>
  
  <blockquote>
    <p>invoke-sqlcmd : Could not load file or assembly
    'Microsoft.SqlServer.BatchParser, Version=15.100.0.0, Culture=neutral,
    PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The
    system cannot find the file specified.</p>
  </blockquote>
  
  <p>If I run the exact same command from regular x64 Powershell prompt I do not get the error</p>
  
  <pre><code>invoke-sqlcmd -Query "SELECT 'HELLO!'" -ServerInstance Server -Database DB
  </code></pre>
  
  <pre><code>Column1
  -------
  HELLO!
  </code></pre>
  
  <p>This is on a newly built windows 2016 x64 bit server:</p>
  
  <p>OS Name Microsoft Windows Server 2016 Datacenter
  Version 10.0.14393 Build 14393</p>
  
  <p>I need x86 powershell to run a script that uses a legacy 32 bit ODBC driver, it also uses <code>invoke-sql</code> commands as well.  </p>