title: WSL - Launch bash from Powershell in new terminal and pass a command to it
body: <p>I am trying to make a simple Powershell script to quickly setup my dev environment. For that I need a few instances of WSL programs running on bash terminals.</p>
  <p>From Powershell, I am trying to:</p>
  <ol>
  <li>Open a new terminal window</li>
  <li>Start bash</li>
  <li>Run a command with bash - In my use case I just want to run a simple <code>npm start</code> within bash.</li>
  </ol>
  <p>A plus is if I can do all of this in one script line.</p>
  <p>I think I am close. If I use <code>start powershell</code> I can start a new terminal. That inmediately opens a new PowerShell terminal.</p>
  <p>Then, I can pass PowersShell commands to it like so:</p>
  <pre><code>start powershell{bash}
  </code></pre>
  <p>This opens a new terminal window and immediately opens bash.</p>
  <p>A way to pass commands to bash in PowerShell is like this:</p>
  <pre><code>bash -c &quot;npm start&quot;
  </code></pre>
  <p>This works well. It opens bash in the same terminal and then runs the command I am passing to it. <code>npm start</code> works just as if I was calling it directly from bash. The problem comes when I want to pass the <code>npm start</code> to the new terminal. This is what I am trying:</p>
  <pre><code>start powershell{ bash -c &quot;npm start&quot;; Read-host}
  </code></pre>
  <p>This opens the new powershell terminal and it seems to be opening bash. <code>; Read-host</code> is added so that the terminal doesn't close immediately. However, instead of running the npm command, it reacts by showing me information about the npm command instead of actually running it.</p>
  <p><a href="https://i.stack.imgur.com/bZXNW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bZXNW.png" alt="enter image description here" /></a></p>
  <p>Is there a workaround so that I can actually get the command to run in the new terminal window after opening bash?</p>