title: Visual Studio - Package Manager Console - Running commands programmatically
body: <p>Every time I update the production website, I need to run 5 commands, who only differ by a name.</p>
  
  <p>I'd like to automatize this (in the future, it could be I have to run these commands 100 times for example).</p>
  
  <p>What I do is:</p>
  
  <pre><code>Update-Database -ConfigurationTypeName "SlaveConfiguration" -StartupProjectName "FacturatieMVCv2.Data" -Verbose -ConnectionString "Server=PC-1\SQLEXPRESS;Persist Security Info=True;Initial Catalog=Database1;uid=prog;password=ndp103@50;" -ConnectionProviderName "System.Data.SqlClient" 
  Update-Database -ConfigurationTypeName "SlaveConfiguration" -StartupProjectName "FacturatieMVCv2.Data" -Verbose -ConnectionString "Server=PC-1\SQLEXPRESS;Persist Security Info=True;Initial Catalog=Database2;uid=prog;password=ndp103@50;" -ConnectionProviderName "System.Data.SqlClient" 
  Update-Database -ConfigurationTypeName "SlaveConfiguration" -StartupProjectName "FacturatieMVCv2.Data" -Verbose -ConnectionString "Server=PC-1\SQLEXPRESS;Persist Security Info=True;Initial Catalog=Database3;uid=prog;password=ndp103@50;" -ConnectionProviderName "System.Data.SqlClient" 
  Update-Database -ConfigurationTypeName "SlaveConfiguration" -StartupProjectName "FacturatieMVCv2.Data" -Verbose -ConnectionString "Server=PC-1\SQLEXPRESS;Persist Security Info=True;Initial Catalog=Database4;uid=prog;password=ndp103@50;" -ConnectionProviderName "System.Data.SqlClient" 
  Update-Database -ConfigurationTypeName "SlaveConfiguration" -StartupProjectName "FacturatieMVCv2.Data" -Verbose -ConnectionString "Server=PC-1\SQLEXPRESS;Persist Security Info=True;Initial Catalog=Database5;uid=prog;password=ndp103@50;" -ConnectionProviderName "System.Data.SqlClient" 
  </code></pre>
  
  <p>How could I write i script, so that, when I type in the console manager:</p>
  
  <pre><code>Update-Database -type Production -version latest
  </code></pre>
  
  <p>It runs all the commands above, without any interference. (All connectionstrings are located in an .XML file like:</p>
  
  <pre><code> &lt;databases&gt;
      &lt;type&gt;Production
          &lt;database&gt;Database1&lt;/database&gt;
          &lt;database&gt;Database2&lt;/database&gt;
          &lt;database&gt;Database3&lt;/database&gt;
          &lt;database&gt;Database4&lt;/database&gt;
          &lt;database&gt;Database5&lt;/database&gt;
      &lt;/type&gt;
   &lt;/databases&gt;
  </code></pre>