title: Trying to execute an exe in powershell script in octopus deploy
body: <p>I've added a step to migrate our database to our dev server in Octopus Deploy. I trying to create a powershell script to do this. In the Nuget package for this deployment, my executable <code>migrate.exe</code> is in <code>\Resources\</code>.</p>
  
  <p>I've written the script like this:</p>
  
  <pre><code>$dbServer = $OctopusParameters["DBServer"]
  $dbUser = $OctopusParameters["DBUser"]
  $dbPass = $OctopusParameters["DBPass"]
  
  Write-Host ("Running migration " + $dbServer)
  
  $CMD = ".\Resources\migrate.exe"
  $arg1 = '--assembly "Database\bin\Debug\Database.dll" --provider sqlserver2014'
  $arg2 = '--connection "data source=$dbServer;initial catalog=MyDB;user id=$dbUser;password=$dbPass;persist security info=true;MultipleActiveResultSets=True" -o'
  
  &amp; $CMD $arg1 $arg2
  
  Write-host("Migration finished " + $dbServer)
  </code></pre>
  
  <p>But I get this message:</p>
  
  <blockquote>
    <p>&amp; : The term '.\Resources\migrate.exe --assembly 
    "Database\bin\Debug\Database.dll" --provider sqlserver2014 --connection "data source=$dbServer;initial 
    catalog=ClarkChains;user id=$dbUser;password=$dbPass;persist security 
    info=true;MultipleActiveResultSets=True" -o' is not recognized as the name of 
    a cmdlet, function, script file, or operable program.</p>
  </blockquote>
  
  <p>I was looking around for examples on how to correctly call an executable.</p>