title: Passing arguments to Start-Job scriptblock?
body: <p>I'd like to setup a cmdlet to start and stop mysql, and I'm trying to do so with Start-Job. the I've got the following in my Powershell profile:</p>
  
  <pre><code>$mysqlpath = "C:\Program Files\MySQL\MySQL Server 5.5\bin"
  Function Start-Mysql
  {
      Start-Job -ScriptBlock { &amp; "$mysqlpath\mysqld.exe" }
  }
  </code></pre>
  
  <p>The variable doesn't seem to be expanding in the job command however? I must be missing some sort of scoping rule. Could someone please advise? Thanks!</p>