Skip to content

Populate Runspace & Debugger properties #55

Description

@TylerLeonhardt

I noticed that Start-Job returns an object that has a property that allows you to get the runspace:

$myJob = Start-Job -ScriptBlock { gci }
$myJob.ChildJobs[0].Runspace
 Id Name            ComputerName    Type          State         Availability
 -- ----            ------------    ----          -----         ------------
  3 Runspace3       localhost       Remote        Closed        None

It can also get the debugger:

$myJob.ChildJobs[0].Debugger

InBreakpoint DebugMode IsActive InstanceId
------------ --------- -------- ----------
       False   Default    False 00000000-0000-0000-0000-000000000000

However, the ThreadJob that comes back from Start-ThreadJob does have a Debugger property but it's not set:

$myThreadJob = Start-ThreadJob -ScriptBlock { gci }
$myThreadJob.Debugger

Can we populate that and also a Runspace property? I think that'll help with debugging threadjobs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions