CmdID / PowerShell / Cmdlets / Debug
Debug-Job
Debugs a running background, remote, or Windows PowerShell Workflow job. PowerShell reference
From the PowerShell reference 6 parameters
What it does
Debugs a running background, remote, or Windows PowerShell Workflow job. The Debug-Job cmdlet lets you debug scripts that are running within jobs. The cmdlet is designed to debug PowerShell Workflow jobs, background jobs, and jobs running in remote sessions. Debug-Job accepts a running job object, name, ID, or instance ID as input, and starts a debugging session on the script it is running. The debugger quit command stops the job and running script. The exit command detaches the debugger, and allows the job to continue to run.
Debug-Job [-Job] <Job> [-WhatIf] [-Confirm] [<CommonParameters>]Debug-Job [-Name] <String> [-WhatIf] [-Confirm] [<CommonParameters>]Debug-Job [-Id] <Int32> [-WhatIf] [-Confirm] [<CommonParameters>]Debug-Job [-InstanceId] <Guid> [-WhatIf] [-Confirm] [<CommonParameters>]
Debug a job by job ID
Debug-Job -Id 3IdentifyIts page in the reference: Debug-Job.
Parameters
-IdSpecifies the ID number of a running job. To get the ID number of a job, run the Get-Job cmdlet.-InstanceIdSpecifies the instance ID GUID of a running job.-JobSpecifies a running job object. The simplest way to use this parameter is to save the results of a
Get-Job command that returns the running job that you want to debug in a variable, and then
specify the variable as the value of this parameter.-NameSpecifies a job by the friendly name of the job. When you start a job, you can specify a job name by adding the JobName parameter, in cmdlets such as Invoke-Command and Start-Job.-ConfirmPrompts you for confirmation before running the cmdlet.-WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.