Partilhar via


Debugger.SetCommandBreakpoint Method

Definition

Overloads

SetCommandBreakpoint(String, ScriptBlock, String, Nullable<Int32>)

Sets a command breakpoint in the debugger.

SetCommandBreakpoint(String, ScriptBlock, String)

Sets a command breakpoint in the current runspace in the debugger.

SetCommandBreakpoint(String, ScriptBlock, String, Nullable<Int32>)

Sets a command breakpoint in the debugger.

public virtual System.Management.Automation.CommandBreakpoint SetCommandBreakpoint (string command, System.Management.Automation.ScriptBlock action, string path, int? runspaceId);
abstract member SetCommandBreakpoint : string * System.Management.Automation.ScriptBlock * string * Nullable<int> -> System.Management.Automation.CommandBreakpoint
override this.SetCommandBreakpoint : string * System.Management.Automation.ScriptBlock * string * Nullable<int> -> System.Management.Automation.CommandBreakpoint
Public Overridable Function SetCommandBreakpoint (command As String, action As ScriptBlock, path As String, runspaceId As Nullable(Of Integer)) As CommandBreakpoint

Parameters

command
String

The name of the command that will trigger the breakpoint. This value may not be null.

action
ScriptBlock

The action to take when the breakpoint is hit. If null, PowerShell will break into the debugger when the breakpoint is hit.

path
String

The path to the script file where the breakpoint may be hit. If null, the breakpoint may be hit anywhere the command is invoked.

runspaceId
Nullable<Int32>

The runspace id of the runspace you want to interact with. A value of null will use the current runspace.

Returns

The command breakpoint that was set.

Applies to

SetCommandBreakpoint(String, ScriptBlock, String)

Sets a command breakpoint in the current runspace in the debugger.

public System.Management.Automation.CommandBreakpoint SetCommandBreakpoint (string command, System.Management.Automation.ScriptBlock action, string path);
member this.SetCommandBreakpoint : string * System.Management.Automation.ScriptBlock * string -> System.Management.Automation.CommandBreakpoint
Public Function SetCommandBreakpoint (command As String, action As ScriptBlock, path As String) As CommandBreakpoint

Parameters

command
String

The name of the command that will trigger the breakpoint. This value may not be null.

action
ScriptBlock

The action to take when the breakpoint is hit. If null, PowerShell will break into the debugger when the breakpoint is hit.

path
String

The path to the script file where the breakpoint may be hit. If null, the breakpoint may be hit anywhere the command is invoked.

Returns

The command breakpoint that was set.

Applies to