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.
$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!!'
A "classic" trick, due to the simple nature of a Process Tree in Windows (just a backwards linked list to each process' ancestor), is to open a separate process that then in turn launches your new "independent" process.