CmdID

CmdID / PowerShell / Cmdlets / Debug

Debug-Process

Debugs one or more processes running on the local computer. PowerShell reference

From the PowerShell reference 5 parameters

Opens CmdID with your command, read as PowerShell. It is read in your browser and sent nowhere.

What it does

from the PowerShell reference, CC BY 4.0

Debugs one or more processes running on the local computer. The Debug-Process cmdlet attaches a debugger to one or more running processes on a local computer. You can specify the processes by their process name or process ID (PID), or you can pipe process objects to this cmdlet. This cmdlet attaches the debugger that's registered for the process. Before using this cmdlet, verify that a debugger is installed and configured.

Debug-Process [-Name] <String[]> [-WhatIf] [-Confirm] [<CommonParameters>]
Debug-Process [-Id] <Int32[]> [-WhatIf] [-Confirm] [<CommonParameters>]
Debug-Process -InputObject <Process[]> [-WhatIf] [-Confirm] [<CommonParameters>]

Attach a debugger to a process on the computer

Debug-Process -Name powershellIdentify

Attach a debugger to all processes that begin with the specified string

Debug-Process -Name note*Identify

Attach a debugger to multiple processes

Debug-Process "Winlogon", "Explorer", "Outlook"Identify

Attach a debugger to multiple process IDs

Debug-Process -Id 1132, 2028Identify

Use Get-Process to get a process then attach a debugger to it

Get-Process powershell | Debug-ProcessIdentify

Attach a debugger to a current process on the local computer

Debug-Process -Id $PIDIdentify

Attach a debugger to the specified process on multiple computers

Get-Process -ComputerName "Server01", "Server02" -Name "MyApp" | Debug-ProcessIdentify

Attach a debugger to a process that uses the InputObject parameter

$P = Get-Process powershell Debug-Process -InputObject $PIdentify

Its page in the reference: Debug-Process.

Parameters

5 in the PowerShell reference
-IdSpecifies the process IDs of the processes to be debugged. The Id parameter name is optional. To find the process ID of a process, type Get-Process.
-InputObjectSpecifies the process objects that represent processes to be debugged. Enter a variable that contains the process objects or a command that gets the process objects, such as the Get-Process cmdlet. You can also pipe process objects to this cmdlet.
-NameSpecifies the names of the processes to be debugged. If there is more than one process with the same name, this cmdlet attaches a debugger to all processes with that name. The Name parameter is optional.
-ConfirmPrompts you for confirmation before running the cmdlet.
-WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.