Remove-PSBreakpoint

Delete breakpoints from the current console.

Syntax
      Remove-PSBreakpoint [-Id] Int32[]
         [-Confirm] [-WhatIf] [CommonParameters]

      Remove-PSBreakpoint [-Breakpoint] Breakpoint[]
         [-Confirm] [-WhatIf] [CommonParameters]

Key
   -Breakpoint Breakpoint[]
       The breakpoints to delete.
       Enter a variable that contains breakpoint objects or a command that
       gets breakpoint objects, such as a Get-PSBreakpoint command.
       (May be piped)

-Id Int32[] Delete breakpoints with the specified breakpoint IDs. -Confirm Prompt for confirmation before executing the command.

-WhatIf Describes what would happen if you executed the command without actually executing the command. CommonParameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -WarningAction, -WarningVariable, -OutBuffer -OutVariable.

Standard Aliases for Remove-PSBreakpoint: rbp

A breakpoint is a point in a command or script where execution stops temporarily so that you can examine the instructions.

Examples

Delete all of the breakpoints in the current console:

PS C:> get-breakpoint | remove-breakpoint

Use the Set-PSBreakpoint cmdlet to create a breakpoint on the SS64 variable in the demo.ps1 script. Then, save the breakpoint object in the $brk variable and use this to delete the new breakpoint:

PS C:> $brk = set-psbreakpoint -script demo.ps1 -variable SS64
PS C:> $brk | remove-psbreakpoint

Get a breakpoint on the ss64 function in demo.ps1 by piping a breakpoint ID:

PS C:> $brk = set-psbreakpoint -script demo.ps1 -function ss64
PS C:> $brk.Id | get-psbreakpoint

Delete the breakpoint with breakpoint ID 5:

PS C:> remove-psbreakpoint -id 5

A function to delete all of the breakpoints in the current console. To save the function permanently, add it to your PowerShell profile:

PS C:> function del-psb { get-psbreakpoint | remove-psbreakpoint }

“Better bend than break” ~ Scottish Proverb

Related:

Enable-PSBreakpoint - Enable breakpoints in the current console


© Copyright SS64.com 1999-2014
Some rights reserved