title: Run a PowerShell method from cmd and don't wait for its return
body: <p>In cmd I'm trying to run <code>Method1</code> which is in a PowerShell script, <code>script1</code>.
  <code>Method1</code> is a method that takes a few hours, and I simply want to fire and forget.</p>
  
  <p>The following is working for me:</p>
  
  <pre><code>c:\temp&gt; powershell
  PS c:\temp&gt; . .\script1.ps1;Method1
  </code></pre>
  
  <p>When I do the lines above, everything is working fine as long as I keep the CMD of PS opened. once I close the PS window, it kills <code>Method1</code>.</p>
  
  <p>So actually I want that from cmd, in one line, to somehow make <code>Method1</code> work without the dependency of the PowerShell window, maybe create a new process.. I am not really sure.</p>
  
  <p>I've tried:</p>
  
  <pre><code>c:\temp&gt; cmd /c powershell . .\script1.ps1;Method1
  </code></pre>
  
  <p>It is running for a few seconds, but when the cmd gets closed, then <code>Method1</code> also terminates.</p>
  
  <p>I also tried</p>
  
  <pre><code>c:\temp&gt;cmd /c powershell -noexit "&amp; { . .\script.ps1;Method1 }"
  </code></pre>
  
  <p>Again, once I do this, it is working. However, a PowerShell window is opened and if I close it then it terminates <code>Method1</code>.</p>
  
  <hr/>
  
  <p>From you help, I've tried:</p>
  
  <pre><code>c:\temp&gt; cmd /c powershell start-process cmd /c powershell . .\script1.ps1;Method1
  </code></pre>
  
  <p>But I get an exception:</p>
  
  <blockquote>
    <p>Start-Process : A positional parameter cannot be found that accepts
    argument 'powershell'.</p>
  </blockquote>
  
  <p>But still, I am not able to make it work.</p>