CmdID / PowerShell / Cmdlets / Debug
Debug-Process
Debugs one or more processes running on the local computer. PowerShell reference
From the PowerShell reference 5 parameters
What it does
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 powershellIdentifyAttach a debugger to all processes that begin with the specified string
Debug-Process -Name note*IdentifyAttach a debugger to multiple processes
Debug-Process "Winlogon", "Explorer", "Outlook"IdentifyAttach a debugger to multiple process IDs
Debug-Process -Id 1132, 2028IdentifyUse Get-Process to get a process then attach a debugger to it
Get-Process powershell | Debug-ProcessIdentifyAttach a debugger to a current process on the local computer
Debug-Process -Id $PIDIdentifyAttach a debugger to the specified process on multiple computers
Get-Process -ComputerName "Server01", "Server02" -Name "MyApp" | Debug-ProcessIdentifyAttach a debugger to a process that uses the InputObject parameter
$P = Get-Process powershell
Debug-Process -InputObject $PIdentifyIts page in the reference: Debug-Process.
Parameters
-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.