Contact Info

Crumbtrail

ActiveXperts.com » Administration » Powershell » Powershell 2.0 » Set-PSBreakpoint

Set-PSBreakpoint - Powershell 2.0 CmdLet

ActiveXperts Network Monitor ships with integrated Powershell scripts to monitor complex network. The scripts run out of the box
Download the ActiveXperts Network Monitor FREE version now »

Set-PSBreakpoint

Short description
Sets a breakpoint on a line, command, or variable.

Syntax


Description
The Set-PSBreakpoint cmdlet sets a breakpoint in a script or in any command run in the current session.  You can us
e Set-PSBreakpoint to set a breakpoint before executing a script or running a command, or during debugging, when st
opped at another breakpoint.

Note: Set-PSBreakpoint cannot set a breakpoint on a remote computer. To debug a script on a remote computer, copy t
he script to the local computer and then debug it locally.

Each Set-PSBreakpoint command creates one of the following three types of breakpoints:
  -- Line breakpoint:  Sets breakpoints at particular line and column coordinates.
  -- Command breakpoint:  Sets breakpoints on commands and functions.
  -- Variable breakpoint: Sets breakpoints on variables.

You can set a breakpoint on multiple lines, commands, or variables in a single Set-PSBreakpoint command, but each S
et-PSBreakpoint command sets only one type of breakpoint. 

At a breakpoint, Windows PowerShell temporarily stops executing and gives control to the debugger. The command prom
pt changes to "DBG>", and a set of debugger commands become available for use. However, you can use the Action para
meter to specify an alternate response, such as conditions for the breakpoint or instructions to perform additional
 tasks such as logging or diagnostics.
 
The Set-PSBreakpoint cmdlet is one of several cmdlets designed for debugging Windows PowerShell scripts. For more i
nformation about the Windows PowerShell debugger, see about_Debuggers.