title: Automate EF-Migrations "Update-Database -Script"
body: <p>I'm using EF migrations to track changes to our EF code-first DB model. Now I need to generate one SQL-Script for each migration, so that I can pass that set of scripts to the DBA.</p>
  
  <p>I was able to generate SQL scripts with <code>Update-Database -Script ...</code> </p>
  
  <p>However, I'd like to automate this. I hoped that the -Script switch would accept a parameter that specifies where to write the SQL to, but this is not the case. Also, output redirection does not work, because the SQL script is not written to STDOUT, but to a temporary file. I see no way of getting hold of that temp file from a script.</p>
  
  <p>Any ideas how to automate the Migrations -> SQL Script generation? Maybe there is some magic powershell trickery that I'm not aware of?</p>
  
  <p>EDIT: By the way, using migrate.exe or any other "migration-aware" approach is not an option, delivering SQL scripts is a must.</p>