title: How to execute .sql file using powershell?
body: <p>I have a .<code>sql</code> file. I am trying to pass connection string details through a Powershell script and invoke an <code>.sql</code> file.</p>
  
  <p>I was searching and came up with a cmdlet related to <code>Invoke-sqlcmd</code>. While I was trying to find a module corresponding to SQL, I did not find any one in my machine.</p>
  
  <p>Should I install anything in my machine (the machine already has SQL Server Management Studio 2008 R2) to get the modules or is there any easy way to execute <code>.sql</code> files using Powershell?</p>