Skip to content

Commit c94ec26

Browse files
Update Enable-PSBreeakpoint PSv7
1 parent b1abe19 commit c94ec26

File tree

1 file changed

+58
-73
lines changed

1 file changed

+58
-73
lines changed

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

Lines changed: 58 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ 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/09/2019
77
online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/enable-psbreakpoint?view=powershell-7&WT.mc_id=ps-gethelp
88
schema: 2.0.0
99
title: Enable-PSBreakpoint
@@ -18,64 +18,70 @@ Enables the breakpoints in the current console.
1818

1919
### Id (Default)
2020

21-
```powershell
21+
```
2222
Enable-PSBreakpoint [-PassThru] [-Id] <Int32[]> [-WhatIf] [-Confirm] [<CommonParameters>]
2323
```
2424

2525
### Breakpoint
2626

27-
```powershell
27+
```
2828
Enable-PSBreakpoint [-PassThru] [-Breakpoint] <Breakpoint[]> [-WhatIf] [-Confirm] [<CommonParameters>]
2929
```
3030

3131
## DESCRIPTION
3232

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.
33+
The `Enable-PSBreakpoint` cmdlet re-enables disabled breakpoints. You can use it to enable all
34+
breakpoints, or specific breakpoints by providing breakpoint objects or IDs.
3635

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.
36+
A breakpoint is a point in a script where execution stops temporarily so that you can examine the
37+
state of the script. Newly created breakpoints are automatically enabled, but can be disabled using
38+
`Disable-PSBreakpoint`.
4139

42-
Technically, this cmdlet changes the value of the Enabled property of a breakpoint object to True.
40+
Technically, this cmdlet changes the value of the **Enabled** property of a breakpoint object to **True**.
4341

44-
`Enable-PSBreakpoint` is one of several cmdlets designed for debugging PowerShell scripts.
45-
For more information about the PowerShell debugger, see about_Debuggers.
42+
`Enable-PSBreakpoint` is one of several cmdlets designed for debugging PowerShell scripts. For more
43+
information about the PowerShell debugger, see
44+
[about_Debuggers](../Microsoft.PowerShell.Core/About/About_Debuggers.md).
4645

4746
## EXAMPLES
4847

4948
### Example 1: Enable all breakpoints
5049

50+
This example enables all breakpoints in the current session.
51+
5152
```powershell
52-
PS C:\> Get-PSBreakpoint | Enable-PSBreakpoint
53+
Get-PSBreakpoint | Enable-PSBreakpoint
5354
```
5455

55-
This command enables all breakpoints in the current console.
56-
You can abbreviate the command as `gbp | ebp`.
56+
Using aliases, this example can be abbreviated as `gbp | ebp`.
5757

5858
### Example 2: Enable breakpoints by ID
5959

60+
This example enables multiple breakpoints using their breakpoint IDs.
61+
6062
```powershell
61-
PS C:\> Enable-PSBreakpoint -Id 0, 1, 5
63+
Enable-PSBreakpoint -Id 0, 1, 5
6264
```
6365

64-
This command enables breakpoints with breakpoint IDs 0, 1, and 5.
65-
6666
### Example 3: Enable a disabled breakpoint
6767

68+
This example re-enables a breakpoint that has been disabled.
69+
6870
```powershell
69-
PS C:\> $B = Set-PSBreakpoint -Script "sample.ps1" -Variable Name
70-
PS C:\> $B | Disable-PSBreakpoint -PassThru
71+
$B = Set-PSBreakpoint -Script "sample.ps1" -Variable Name -PassThru
72+
$B | Enable-PSBreakpoint -PassThru
73+
```
74+
75+
```Output
7176
AccessMode : Write
7277
Variable : Name
7378
Action :
7479
Enabled : False
7580
HitCount : 0
7681
Id : 0
7782
Script : C:\ps-test\sample.ps1
78-
ScriptName : C:\ps-test\sample.ps1 PS C:\> $B | Enable-PSBreakpoint -PassThru
83+
ScriptName : C:\ps-test\sample.ps1
84+
7985
AccessMode : Write
8086
Variable : Name
8187
Action :
@@ -86,50 +92,34 @@ Script : C:\ps-test\sample.ps1
8692
ScriptName : C:\ps-test\sample.ps1
8793
```
8894

89-
These commands re-enable a breakpoint that has been disabled.
90-
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.
95+
`Set-PSBreakpoint` creates a breakpoint on the **Name** variable in the `Sample.ps1` script saving
96+
the breakpoint object in the `$B` variable. The **PassThru** parameter displays the value of the
97+
**Enabled** property of the breakpoint is **False**.
9498

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.
101-
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.
107-
108-
The results are shown in the following sample output.
99+
`Enable-PSBreakpoint` re-enables the breakpoint and using the **PassThru** parameter to display the
100+
value of the **Enabled** property is **True**.
109101

110102
### Example 4: Enable breakpoints using a variable
111103

104+
This example enables a set of breakpoints using the breakpoint objects.
105+
112106
```powershell
113-
PS C:\> $B = Get-PSBreakpoint -Id 3, 5
114-
PS C:\> Enable-PSBreakpoint -Breakpoint $B
107+
$B = Get-PSBreakpoint -Id 3, 5
108+
Enable-PSBreakpoint -Breakpoint $B
115109
```
116110

117-
These commands enable a set of breakpoints by specifying their breakpoint objects.
118-
119-
The first command uses the Get-PSBreakpoint cmdlet to get the breakpoints and saves them in the $B variable.
111+
`Get-PSBreakpoint` gets breakpoints by ID number and stores them in the `$B` variable.
120112

121-
The second command uses the `Enable-PSBreakpoint` cmdlet and its **Breakpoint**
122-
parameter to enable the breakpoints.
113+
`Enable-PSBreakpoint` enables the breakpoints stored in `$B` using the **Breakpoint** parameter.
123114

124-
This command is the equivalent of `Enable-PSBreakpoint -Id 3, 5`.
115+
This example is the equivalent of `Enable-PSBreakpoint -Id 3, 5`.
125116

126117
## PARAMETERS
127118

128119
### -Breakpoint
129120

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`.
121+
Specifies the breakpoints to enable. Provide a variable or a command, such as `Get-PSBreakpoint`,
122+
that contains breakpoint objects. You can also pipe breakpoint objects to `Enable-PSBreakpoint`.
133123

134124
```yaml
135125
Type: Breakpoint[]
@@ -145,11 +135,9 @@ Accept wildcard characters: False
145135
146136
### -Id
147137
148-
Specifies breakpoint IDs that this cmdlet enables.
149-
The default value is all breakpoints.
150-
Enter the IDs or a variable that contains the IDs.
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.
138+
Specifies breakpoint **ID** numbers to enable. The default value is all breakpoints. Provide a list
139+
or variable that contains **ID** numbers. You cannot use the pipeline to send **ID** numbers to
140+
`Enable-PSBreakpoint`. To find the **ID** number of a breakpoint, use the `Get-PSBreakpoint` cmdlet.
153141

154142
```yaml
155143
Type: Int32[]
@@ -165,8 +153,8 @@ Accept wildcard characters: False
165153

166154
### -PassThru
167155

168-
Returns an object representing the item with which you are working.
169-
By default, this cmdlet does not generate any output.
156+
Returns an object representing the item with which you are working. By default, this cmdlet does not
157+
generate any output.
170158

171159
```yaml
172160
Type: SwitchParameter
@@ -198,8 +186,7 @@ Accept wildcard characters: False
198186

199187
### -WhatIf
200188

201-
Shows what would happen if the cmdlet runs.
202-
The cmdlet is not run.
189+
Shows what would happen if the cmdlet runs. The cmdlet is not run.
203190

204191
```yaml
205192
Type: SwitchParameter
@@ -215,10 +202,9 @@ Accept wildcard characters: False
215202

216203
### CommonParameters
217204

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
205+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
206+
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
207+
-WarningAction, and -WarningVariable. For more information, see
222208
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
223209

224210
## INPUTS
@@ -231,18 +217,17 @@ You can pipe a breakpoint object to `Enable-PSBreakpoint`.
231217

232218
### None or System.Management.Automation.Breakpoint
233219

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.
220+
When you use the **PassThru** parameter, `Enable-PSBreakpoint` returns a result that the breakpoint
221+
is enabled. Otherwise, this does not generate any output.
237222

238223
## NOTES
239224

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.
225+
- The `Enable-PSBreakpoint` cmdlet does not generate an error if you try to enable a breakpoint that
226+
is already enabled. As such, you can enable all breakpoints without error, even when only a few
227+
are disabled.
243228

244-
- Breakpoints are enabled when you create them by using the `Set-PSBreakpoint` cmdlet.
245-
You do not need to enable newly created breakpoints.
229+
- Breakpoints are enabled when you create them by using the `Set-PSBreakpoint` cmdlet. You do not
230+
need to enable newly created breakpoints.
246231

247232
## RELATED LINKS
248233

0 commit comments

Comments
 (0)