title: Launch an unparented process from PowerShell
body: <p>By default, when you launch a process from PowerShell, it is attached to its parent (the shell). If you kill the process tree, these processes also die. I would like to launch a process that is a peer to the shell; aka. when I kill the PowerShell tree, I don't want it to die.</p>
  
  <pre><code>$spotifyProcess = start Spotify.exe -PassThru
  
  $spotifyParentId = (gwmi win32_process -Filter "processid='$($spotifyProcess.Id)'").ParentProcessId
  $shellId = [System.Diagnostics.Process]::GetCurrentProcess().Id
  
  if ($spotifyParentId -eq $shellId)
  {
      throw 'Not what I want!!'
  }
  </code></pre>