PowerShell Logo Small

Get-PSBreakpoint



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

Gets the breakpoints that are set in the current session.

SYNTAX


Get-PSBreakpoint [[-Script] [<String[]>]] [-InformationAction {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend}] [-InformationVariable [<System.String>]]
[<CommonParameters>]
Get-PSBreakpoint [-InformationAction {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend}] [-InformationVariable [<System.String>]] [-Script [<String[]>]]
-Command <String[]> [<CommonParameters>]
Get-PSBreakpoint [-Id] <Int32[]> [-InformationAction {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend}] [-InformationVariable [<System.String>]]
[<CommonParameters>]
Get-PSBreakpoint [-InformationAction {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend}] [-InformationVariable [<System.String>]] [-Script [<String[]>]]
-Variable <String[]> [<CommonParameters>]
Get-PSBreakpoint [-Type] <BreakpointType[]> [-InformationAction {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend}] [-InformationVariable [<System.String>]]
[-Script [<String[]>]] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Get-PSBreakPoint cmdlet gets the breakpoints that are set in the current session. You can use the cmdlet parameters to get particular breakpoints.


A breakpoint is a point in a command or script where execution stops temporarily so that you can examine the instructions. Get-PSBreakpoint is one of several cmdlets
designed for debugging Windows PowerShell scripts and commands. For more information about the Windows PowerShell debugger, see about_Debuggers.



<

RELATED LINKS

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

REMARKS

<

Examples


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

PS C:\>get-psbreakpoint



Description

-----------

This command gets all breakpoints set on all scripts and functions in the current session.










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

PS C:\>get-psbreakpoint -Id 2

Function :
IncrementAction :
Enabled :
TrueHitCount : 0
Id : 2
Script : C:\ps-test\sample.ps1
ScriptName : C:\ps-test\sample.ps1



Description

-----------

This command gets the breakpoint with breakpoint ID 2.










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

PS C:\>$b = set-psbreakpoint -script sample.ps1 -function increment
PS C:\> $b.Id | get-psbreakpoint



Description

-----------

These commands show how to get a breakpoint by piping a breakpoint ID to Get-PSBreakpoint.

The first command uses the Set-PSBreakpoint cmdlet to create a breakpoint on the Increment function in the Sample.ps1 script. It saves the breakpoint object in the $b
variable.

The second command uses the dot operator (.) to get the Id property of the breakpoint object in the $b variable. It uses a pipeline operator (|) to send the ID to the
Get-PSBreakpoint cmdlet.

As a result, Get-PSBreakpoint gets the breakpoint with the specified ID.










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

PS C:\>get-psbreakpoint -script Sample.ps1, SupportScript.ps1



Description

-----------

This command gets all of the breakpoints in the Sample.ps1 and SupportScript.ps1 files.

This command does not get other breakpointS that might be set in other scripts or on functions in the session.










-------------------------- EXAMPLE 5 --------------------------

PS C:\>get-psbreakpoint -command Read-Host, Write-Host -script Sample.ps1



Description

-----------

This command gets all Command breakpoints that are set on Read-Host or Write-Host commands in the Sample.ps1 file.










-------------------------- EXAMPLE 6 --------------------------

PS C:\>get-psbreakpoint -type Command -script Sample.ps1



Description

-----------

This command gets all Command breakpoints in the Sample.ps1 file.










-------------------------- EXAMPLE 7 --------------------------

PS C:\>get-psbreakpoint -variable Index, Swap



Description

-----------

This command gets breakpoints that are set on the $index and $swap variables in the current session.










-------------------------- EXAMPLE 8 --------------------------

PS C:\>get-psbreakpoint -type line, variable -script Sample.ps1



Description

-----------

This command gets all line and variable breakpoints in the Sample.ps1 script.