Skip to content

Commit 20dd3ab

Browse files
Updated Enable-PSBreakpoint V7
1 parent 7b73176 commit 20dd3ab

File tree

1 file changed

+50
-36
lines changed

1 file changed

+50
-36
lines changed

reference/7/Microsoft.PowerShell.Utility/Enable-PSBreakpoint.md

Lines changed: 50 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml
33
keywords: powershell,cmdlet
44
locale: en-us
55
Module Name: Microsoft.PowerShell.Utility
6-
ms.date: 06/09/2017
6+
ms.date: 10/07/2019
77
online version: https://go.microsoft.com/fwlink/?linkid=2096700
88
schema: 2.0.0
99
title: Enable-PSBreakpoint
1010
---
11+
1112
# Enable-PSBreakpoint
1213

1314
## SYNOPSIS
@@ -17,34 +18,37 @@ Enables the breakpoints in the current console.
1718

1819
### Id (Default)
1920

20-
```
21+
```powershell
2122
Enable-PSBreakpoint [-PassThru] [-Id] <Int32[]> [-WhatIf] [-Confirm] [<CommonParameters>]
2223
```
2324

2425
### Breakpoint
2526

26-
```
27+
```powershell
2728
Enable-PSBreakpoint [-PassThru] [-Breakpoint] <Breakpoint[]> [-WhatIf] [-Confirm] [<CommonParameters>]
2829
```
2930

3031
## DESCRIPTION
3132

32-
The **Enable-PSBreakpoint** cmdlet re-enables disabled breakpoints.
33-
You can use it to enable all breakpoints, or you can specify breakpoints by submitting breakpoint objects or breakpoint IDs.
33+
The `Enable-PSBreakpoint` cmdlet re-enables disabled breakpoints. You can use
34+
it to enable all breakpoints, or you can specify breakpoints by submitting
35+
breakpoint objects or breakpoint IDs.
3436

35-
A breakpoint is a point in a script where execution stops temporarily so that you can examine the instructions in the script.
36-
Newly created breakpoints are automatically enabled, but you can disable them by using the Disable-PSBreakpoint cmdlet.
37+
A breakpoint is a point in a script where execution stops temporarily so that
38+
you can examine the instructions in the script. Newly created breakpoints are
39+
automatically enabled, but you can disable them by using the
40+
`Disable-PSBreakpoint` cmdlet.
3741

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

40-
**Enable-PSBreakpoint** is one of several cmdlets designed for debugging PowerShell scripts.
44+
`Enable-PSBreakpoint` is one of several cmdlets designed for debugging PowerShell scripts.
4145
For more information about the PowerShell debugger, see about_Debuggers.
4246

4347
## EXAMPLES
4448

4549
### Example 1: Enable all breakpoints
4650

47-
```
51+
```powershell
4852
PS C:\> Get-PSBreakpoint | Enable-PSBreakpoint
4953
```
5054

@@ -53,15 +57,15 @@ You can abbreviate the command as `gbp | ebp`.
5357

5458
### Example 2: Enable breakpoints by ID
5559

56-
```
60+
```powershell
5761
PS C:\> Enable-PSBreakpoint -Id 0, 1, 5
5862
```
5963

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

6266
### Example 3: Enable a disabled breakpoint
6367

64-
```
68+
```powershell
6569
PS C:\> $B = Set-PSBreakpoint -Script "sample.ps1" -Variable Name
6670
PS C:\> $B | Disable-PSBreakpoint -PassThru
6771
AccessMode : Write
@@ -84,22 +88,28 @@ ScriptName : C:\ps-test\sample.ps1
8488

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

87-
The first command uses the Set-PSBreakpoint cmdlet to create a breakpoint on the Name variable in the Sample.ps1 script.
88-
Then, it saves the breakpoint object in the $B variable.
91+
The first command uses the `Set-PSBreakpoint` cmdlet to create a breakpoint on the
92+
Name variable in the Sample.ps1 script. Then, it saves the breakpoint object in
93+
the $B variable.
8994

90-
The second command uses the Disable-PSBreakpoint cmdlet to disable the new breakpoint.
91-
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.
92-
This lets you verify that the value of the Enabled property of the breakpoint object is False.
95+
The second command uses the `Disable-PSBreakpoint` cmdlet to disable the new
96+
breakpoint. It uses a pipeline operator (|) to send the breakpoint object in $B
97+
to the `Disable-PSBreakpoint` cmdlet, and it uses the **PassThru** parameter of
98+
`Disable-PSBreakpoint` to display the disabled breakpoint object. This lets
99+
you verify that the value of the Enabled property of the breakpoint object is
100+
False.
93101

94-
The third command uses the **Enable-PSBreakpoint** cmdlet to re-enable the breakpoint.
95-
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.
96-
This lets you verify that the value of the Enabled property of the breakpoint object is True.
102+
The third command uses the `Enable-PSBreakpoint` cmdlet to re-enable the
103+
breakpoint. It uses a pipeline operator (|) to send the breakpoint object in $B
104+
to the `Enable-PSBreakpoint` cmdlet, and it uses the **PassThru** parameter of
105+
`Enable-PSBreakpoint` to display the breakpoint object. This lets you verify
106+
that the value of the Enabled property of the breakpoint object is True.
97107

98108
The results are shown in the following sample output.
99109

100110
### Example 4: Enable breakpoints using a variable
101111

102-
```
112+
```powershell
103113
PS C:\> $B = Get-PSBreakpoint -Id 3, 5
104114
PS C:\> Enable-PSBreakpoint -Breakpoint $B
105115
```
@@ -108,17 +118,18 @@ These commands enable a set of breakpoints by specifying their breakpoint object
108118

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

111-
The second command uses the **Enable-PSBreakpoint** cmdlet and its *Breakpoint* parameter to enable the breakpoints.
121+
The second command uses the `Enable-PSBreakpoint` cmdlet and its **Breakpoint**
122+
parameter to enable the breakpoints.
112123

113124
This command is the equivalent of `Enable-PSBreakpoint -Id 3, 5`.
114125

115126
## PARAMETERS
116127

117128
### -Breakpoint
118129

119-
Specifies the breakpoints to enable.
120-
Enter a variable that contains breakpoint objects or a command that gets breakpoint objects, such as a Get-PSBreakpoint command.
121-
You can also pipe breakpoint objects to **Enable-PSBreakpoint**.
130+
Specifies the breakpoints to enable. Enter a variable that contains breakpoint
131+
objects or a command that gets breakpoint objects, such as a `Get-PSBreakpoint`
132+
command. You can also pipe breakpoint objects to `Enable-PSBreakpoint`.
122133

123134
```yaml
124135
Type: Breakpoint[]
@@ -137,8 +148,8 @@ Accept wildcard characters: False
137148
Specifies breakpoint IDs that this cmdlet enables.
138149
The default value is all breakpoints.
139150
Enter the IDs or a variable that contains the IDs.
140-
You cannot use the pipeline to send IDs to **Enable-PSBreakpoint**.
141-
To find the ID of a breakpoint, use the Get-PSBreakpoint cmdlet.
151+
You cannot use the pipeline to send IDs to `Enable-PSBreakpoint`.
152+
To find the ID of a breakpoint, use the `Get-PSBreakpoint` cmdlet.
142153

143154
```yaml
144155
Type: Int32[]
@@ -204,30 +215,35 @@ Accept wildcard characters: False
204215

205216
### CommonParameters
206217

207-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
218+
This cmdlet supports the common parameters: -Debug, -ErrorAction,
219+
-ErrorVariable, -InformationAction, -InformationVariable, -OutVariable,
220+
-OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
221+
For more information, see
222+
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
208223

209224
## INPUTS
210225

211226
### System.Management.Automation.Breakpoint
212227

213-
You can pipe a breakpoint object to **Enable-PSBreakpoint**.
228+
You can pipe a breakpoint object to `Enable-PSBreakpoint`.
214229

215230
## OUTPUTS
216231

217232
### None or System.Management.Automation.Breakpoint
218233

219-
When you use the *PassThru* parameter, **Enable-PSBreakpoint** returns a breakpoint object that represent that breakpoint that was enabled.
220-
Otherwise, this cmdlet does not generate any output.
234+
When you use the **PassThru** parameter, `Enable-PSBreakpoint` returns a
235+
breakpoint object that represent that breakpoint that was enabled. Otherwise,
236+
this cmdlet does not generate any output.
221237

222238
## NOTES
223239

224-
* The **Enable-PSBreakpoint** cmdlet does not generate an error if you try to enable a breakpoint that is already enabled. As such, you can enable all breakpoints without error, even when only a few are disabled.
240+
- The `Enable-PSBreakpoint` cmdlet does not generate an error if you try to
241+
enable a breakpoint that is already enabled. As such, you can enable all
242+
breakpoints without error, even when only a few are disabled.
225243

226-
Breakpoints are enabled when you create them by using the Set-PSBreakpoint cmdlet.
244+
- Breakpoints are enabled when you create them by using the `Set-PSBreakpoint` cmdlet.
227245
You do not need to enable newly created breakpoints.
228246

229-
*
230-
231247
## RELATED LINKS
232248

233249
[Disable-PSBreakpoint](Disable-PSBreakpoint.md)
@@ -239,5 +255,3 @@ You do not need to enable newly created breakpoints.
239255
[Remove-PSBreakpoint](Remove-PSBreakpoint.md)
240256

241257
[Set-PSBreakpoint](Set-PSBreakpoint.md)
242-
243-

0 commit comments

Comments
 (0)