@@ -3,7 +3,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml
3
3
keywords : powershell,cmdlet
4
4
locale : en-us
5
5
Module Name : Microsoft.PowerShell.Utility
6
- ms.date : 06 /09/2017
6
+ ms.date : 10 /09/2019
7
7
online version : https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/enable-psbreakpoint?view=powershell-7&WT.mc_id=ps-gethelp
8
8
schema : 2.0.0
9
9
title : Enable-PSBreakpoint
@@ -18,64 +18,70 @@ Enables the breakpoints in the current console.
18
18
19
19
### Id (Default)
20
20
21
- ``` powershell
21
+ ```
22
22
Enable-PSBreakpoint [-PassThru] [-Id] <Int32[]> [-WhatIf] [-Confirm] [<CommonParameters>]
23
23
```
24
24
25
25
### Breakpoint
26
26
27
- ``` powershell
27
+ ```
28
28
Enable-PSBreakpoint [-PassThru] [-Breakpoint] <Breakpoint[]> [-WhatIf] [-Confirm] [<CommonParameters>]
29
29
```
30
30
31
31
## DESCRIPTION
32
32
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.
36
35
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 ` .
41
39
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** .
43
41
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 ) .
46
45
47
46
## EXAMPLES
48
47
49
48
### Example 1: Enable all breakpoints
50
49
50
+ This example enables all breakpoints in the current session.
51
+
51
52
``` powershell
52
- PS C:\> Get-PSBreakpoint | Enable-PSBreakpoint
53
+ Get-PSBreakpoint | Enable-PSBreakpoint
53
54
```
54
55
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 ` .
57
57
58
58
### Example 2: Enable breakpoints by ID
59
59
60
+ This example enables multiple breakpoints using their breakpoint IDs.
61
+
60
62
``` powershell
61
- PS C:\> Enable-PSBreakpoint -Id 0, 1, 5
63
+ Enable-PSBreakpoint -Id 0, 1, 5
62
64
```
63
65
64
- This command enables breakpoints with breakpoint IDs 0, 1, and 5.
65
-
66
66
### Example 3: Enable a disabled breakpoint
67
67
68
+ This example re-enables a breakpoint that has been disabled.
69
+
68
70
``` 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
71
76
AccessMode : Write
72
77
Variable : Name
73
78
Action :
74
79
Enabled : False
75
80
HitCount : 0
76
81
Id : 0
77
82
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
+
79
85
AccessMode : Write
80
86
Variable : Name
81
87
Action :
@@ -86,50 +92,34 @@ Script : C:\ps-test\sample.ps1
86
92
ScriptName : C:\ps-test\sample.ps1
87
93
```
88
94
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** .
94
98
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** .
109
101
110
102
### Example 4: Enable breakpoints using a variable
111
103
104
+ This example enables a set of breakpoints using the breakpoint objects.
105
+
112
106
``` 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
115
109
```
116
110
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.
120
112
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.
123
114
124
- This command is the equivalent of ` Enable-PSBreakpoint -Id 3, 5 ` .
115
+ This example is the equivalent of ` Enable-PSBreakpoint -Id 3, 5 ` .
125
116
126
117
## PARAMETERS
127
118
128
119
### -Breakpoint
129
120
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 ` .
133
123
134
124
``` yaml
135
125
Type : Breakpoint[]
@@ -145,11 +135,9 @@ Accept wildcard characters: False
145
135
146
136
### -Id
147
137
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.
153
141
154
142
` ` ` yaml
155
143
Type: Int32[]
@@ -165,8 +153,8 @@ Accept wildcard characters: False
165
153
166
154
# ## -PassThru
167
155
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.
170
158
171
159
` ` ` yaml
172
160
Type: SwitchParameter
@@ -198,8 +186,7 @@ Accept wildcard characters: False
198
186
199
187
# ## -WhatIf
200
188
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.
203
190
204
191
` ` ` yaml
205
192
Type: SwitchParameter
@@ -215,10 +202,9 @@ Accept wildcard characters: False
215
202
216
203
# ## CommonParameters
217
204
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
222
208
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
223
209
224
210
# # INPUTS
@@ -231,18 +217,17 @@ You can pipe a breakpoint object to `Enable-PSBreakpoint`.
231
217
232
218
# ## None or System.Management.Automation.Breakpoint
233
219
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.
237
222
238
223
# # NOTES
239
224
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.
243
228
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.
246
231
247
232
# # RELATED LINKS
248
233
0 commit comments