Enable a breakpoint (or several breakpoints) in the current console, for debugging a .ps1 script.
Syntax
Enable-PSBreakpoint [-Id] Int32[]
[-PassThru] [-Confirm] [-WhatIf] [CommonParameters]
Enable-PSBreakpoint [-Breakpoint] Breakpoint[]
[-PassThru] [-Confirm] [-WhatIf] [CommonParameters]
Key
-Breakpoint Breakpoint[]
The breakpoints to enable. Enter a variable that contains breakpoint
objects or a command that gets breakpoint objects, (Get-PSBreakpoint).
You can also pipe breakpoint objects.
-Id Int32[]
Enable breakpoints with the specified breakpoint IDs.
Enter the IDs or a variable that contains the IDs.
You cannot pipe IDs to Disable-PSBreakpoint.
-PassThru
Return an object representing the enabled breakpoints.
By default, this cmdlet does not generate any output.
-confirm
Prompt for confirmation before executing the command.
-whatIf
Describe what would happen if you executed the command without actually
executing the command.
Standard Aliases for Enable-PSBreakpoint: ebp
Enable breakpoints id 0 and id 5:
PS C:> Enable-PSBreakpoint -id 0,5
Enable breakpoints 1 and 3:
PS C:> $bpoint = get-psbreakpoint -id 1, 3
PS C:> Enable-PSBreakpoint -breakpoint $bpoint
Create, disable and then enable a breakpoint on the "windevcluster" variable in the script demo.ps1:
PS C:> $brk = Set-PSBreakpoint -script demo.ps1 -variable windevcluster
PS C:> $brk | Disable-PSBreakpoint -passthru
...
PS C:> $brk | Enable-PSBreakpoint -passthru
Enable all breakpoints in the current console:
PS C:> Get-PSBreakpoint | Enable-PSBreakpoint
“The heart is the only broken instrument that works” ~ T. E. Kalem
Disable-PSBreakpoint - Disable a breakpoint in the current console.
Get-PSBreakpoint - Get the currently set breakpoints.
How to Debug Scripts in Windows PowerShell ISE.