I want to launch a “background” task as a ThreadJob, as part of a larger script. The script will likely finish before the job, and it’s okay if the user exits PowerShell before the job finishes. I don’t mind if the user can see it (via Get-Job) while it’s running, but it would be nice to automagically clean it up when it finishes. But I can’t find a way for it to remove itself… it seems the job is invisible to itself. It would be nice if this could be supported somehow (perhaps an -AutoRemoveJob option?).
Thanks!