PowerShell Logo Small

Disable-PSBreakpoint



This is the built-in help made by Microsoft for the command 'Disable-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

Disables the breakpoints in the current console.

SYNTAX


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



Search powershellhelp.space

DESCRIPTION


The Disable-PSBreakpoint cmdlet disables breakpoints, which assures that they are not hit when the script runs. You can use it to disable all breakpoints, or you can specify
breakpoints by submitting breakpoint objects or breakpoint IDs.


Technically, this cmdlet changes the value of the Enabled property of a breakpoint object to False. To re-enable a breakpoint, use the Enable-PSBreakpoint cmdlet.
Breakpoints are enabled by default when you create them by using the Set-PSBreakpoint cmdlet.


A breakpoint is a point in a script where execution stops temporarily so that you can examine the instructions in the script. Disable-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=293953
Enable-PSBreakpoint
Get-PSBreakpoint
Get-PSCallStack
Remove-PSBreakpoint
Set-PSBreakpoint
about_Debuggers

REMARKS

<

Examples


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

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



These commands disable a newly-created breakpoint.

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.

As a result of this command, the value of the Enabled property of the breakpoint object in $b is False.










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

PS C:\>disable-psbreakpoint -id 0



This command disables the breakpoint with breakpoint ID 0.










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

PS C:\>disable-psbreakpoint -breakpoint ($b = set-psbreakpoint -script sample.ps1 -line 5)
PS C:\>$b



This command creates a new breakpoint that is disabled until you enable it.

It uses the Disable-PSBreakpoint cmdlet to disable the breakpoint. The value of the Breakpoint parameter is a Set-PSBreakpoint command that sets a new breakpoint, generates
a breakpoint object, and saves the object in the $b variable.

Cmdlet parameters that take objects as their values can accept a variable that contains the object or a command that gets or generates the object. In this case, because
Set-PSBreakpoint generates a breakpoint object, it can be used as the value of the Breakpoint parameter.

The second command displays the breakpoint object in the value of the $b variable.










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

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



This command disables all breakpoints in the current console. You can abbreviate this command as: "gbp | dbp".