PowerShell Logo Small

Enable-PSBreakpoint



This is the built-in help made by Microsoft for the command 'Enable-PSBreakpoint', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Enables the breakpoints in the current console.

SYNTAX


Enable-PSBreakpoint [-Id] <Int32[]> [-InformationAction {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend}] [-InformationVariable [<System.String]>]]
[-PassThru] [<CommonParameters>]
Enable-PSBreakpoint [-Breakpoint] <Breakpoint[]> [-InformationAction {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend}] [-InformationVariable
[<System.String]>]] [-PassThru] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Enable-PSBreakpoint cmdlet re-enables disabled breakpoints. You can use it to enable all breakpoints, or you can specify breakpoints by submitting breakpoint objects or
breakpoint IDs.


A breakpoint is a point in a script where execution stops temporarily so that you can examine the instructions in the script. Newly created breakpoints are automatically
enabled, but you can disable them by using the Disable-PSBreakpoint cmdlet.


Technically, this cmdlet changes the value of the Enabled property of a breakpoint object to True.


Enable-PSBreakpoint is one of several cmdlets designed for debugging Windows PowerShell scripts. For more information about the Windows PowerShell debugger, see
about_Debuggers.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/p/?linkid=293954
Disable-PSBreakpoint
Get-PSBreakpoint
Get-PSCallStack
Remove-PSBreakpoint
Set-PSBreakpoint
about_Debuggers

REMARKS

<

Examples


-------------------------- EXAMPLE 1 --------------------------

PS C:\>get-psbreakpoint | enable-psbreakpoint



This command enables all breakpoints in the current console. You can abbreviate the command as "gbp | ebp".










-------------------------- EXAMPLE 2 --------------------------

PS C:\>enable-psbreakpoint -id 0, 1, 5



This command enables breakpoints with breakpoint IDs 0, 1, and 5.










-------------------------- EXAMPLE 3 --------------------------

PS C:\>$b = set-psbreakpoint -script sample.ps1 -variable Name
PS C:\>$b | disable-psbreakpoint -passthru

AccessMode : Write
Variable : Name
Action :
Enabled : False
HitCount : 0
Id : 0
Script : C:\ps-test\sample.ps1
ScriptName : C:\ps-test\sample.ps1

PS C:\>$b | enable-psbreakpoint -passthru

AccessMode : Write
Variable : Name
Action :
Enabled : True
HitCount : 0
Id : 0
Script : C:\ps-test\sample.ps1
ScriptName : C:\ps-test\sample.ps1



These commands re-enable a breakpoint that has been disabled.

The first command uses the Set-PSBreakpoint cmdlet to create a breakpoint on the "Name" variable in the Sample.ps1 script. Then, it saves the breakpoint object in the $b
variable.

The second command uses the Disable-PSBreakpoint cmdlet to disable the new breakpoint. It uses a pipeline operator (|) to send the breakpoint object in $b to the
Disable-PSBreakpoint cmdlet, and it uses the PassThru parameter of Disable-PSBreakpoint to display the disabled breakpoint object. This lets you verify that the value of the
Enabled property of the breakpoint object is False.

The third command uses the Enable-PSBreakpoint cmdlet to re-enable the breakpoint. It uses a pipeline operator (|) to send the breakpoint object in $b to the
Enable-PSBreakpoint cmdlet, and it uses the PassThru parameter of Enable-PSBreakpoint to display the breakpoint object. This lets you verify that the value of the Enabled
property of the breakpoint object is True.

The results are shown in the following sample output.










-------------------------- EXAMPLE 4 --------------------------

PS C:\>$b = get-psbreakpoint -id 3, 5
PS C:\>enable-psbreakpoint -breakpoint $b



These commands enable a set of breakpoints by specifying their breakpoint objects.

The first command uses the Get-PSBreakpoint cmdlet to get the breakpoints and saves them in the $b variable.

The second command uses the Enable-PSBreakpoint cmdlet and its Breakpoint parameter to enable the breakpoints.

This command is the equivalent of "enable-psbreakpoint -id 3, 5".