You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These commands re-enable a breakpoint that has been disabled.
96
+
`Set-PSBreakpoint` creates a breakpoint on the **Name** variable in the `Sample.ps1` script saving
97
+
the breakpoint object in the `$B` variable. The **PassThru** parameter displays the value of the
98
+
**Enabled** property of the breakpoint is **False**.
90
99
91
-
The first command uses the Set-PSBreakpoint cmdlet to create a breakpoint on the "Name" variable in the Sample.ps1 script.
92
-
Then, it saves the breakpoint object in the $b variable.
100
+
`Enable-PSBreakpoint` re-enables the breakpoint. Again, using the **PassThru** parameter we see that
101
+
the value of the **Enabled** property is **True**.
93
102
94
-
The second command uses the Disable-PSBreakpoint cmdlet to disable the new breakpoint.
95
-
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.
96
-
This lets you verify that the value of the Enabled property of the breakpoint object is False.
103
+
### Example 4: Enable breakpoints using a variable
97
104
98
-
The third command uses the Enable-PSBreakpoint cmdlet to re-enable the breakpoint.
99
-
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.
100
-
This lets you verify that the value of the Enabled property of the breakpoint object is True.
101
-
102
-
The results are shown in the following sample output.
103
-
104
-
### Example 4
105
+
This example enables a set of breakpoints using the breakpoint objects.
105
106
106
107
```powershell
107
-
$b = Get-PSBreakpoint -Id 3, 5
108
-
Enable-PSBreakpoint -Breakpoint $b
108
+
$B = Get-PSBreakpoint -Id 3, 5
109
+
Enable-PSBreakpoint -Breakpoint $B
109
110
```
110
111
111
-
These commands enable a set of breakpoints by specifying their breakpoint objects.
112
-
113
-
The first command uses the Get-PSBreakpoint cmdlet to get the breakpoints and saves them in the $b variable.
112
+
`Get-PSBreakpoint` gets the breakpoints and saves them in the `$B` variable. Using the
113
+
**Breakpoint** parameter, `Enable-PSBreakpoint` enables the breakpoints.
114
114
115
-
The second command uses the Enable-PSBreakpoint cmdlet and its Breakpoint parameter to enable the breakpoints.
116
-
117
-
This command is the equivalent of "enable-psbreakpoint -id 3, 5".
115
+
This example is equivalent to running `Enable-PSBreakpoint -Id 3, 5`.
118
116
119
117
## PARAMETERS
120
118
121
119
### -Breakpoint
122
120
123
-
Specifies the breakpoints to enable.
124
-
Enter a variable that contains breakpoint objects or a command that gets breakpoint objects, such as a Get-PSBreakpoint command.
125
-
You can also pipe breakpoint objects to Enable-PSBreakpoint.
121
+
Specifies the breakpoints to enable. Provide a variable containing breakpoints or a command that
122
+
gets breakpoint objects, such as `Get-PSBreakpoint`. You can also pipe breakpoint objects to
123
+
`Enable-PSBreakpoint`.
126
124
127
125
```yaml
128
126
Type: Breakpoint[]
129
127
Parameter Sets: Breakpoint
130
128
Aliases:
131
129
132
130
Required: True
133
-
Position: 1
134
-
Default value: None.
131
+
Position: 0
132
+
Default value: None
135
133
Accept pipeline input: True (ByValue)
136
134
Accept wildcard characters: False
137
135
```
138
136
139
137
### -Id
140
138
141
-
Enables breakpoints that have the specified breakpoint IDs.
142
-
The default value is all breakpoints.
143
-
Enter the IDs or a variable that contains the IDs.
144
-
(You cannot pipe IDs to Enable-PSBreakpoint.) To find the ID of a breakpoint, use the Get-PSBreakpoint cmdlet.
139
+
Specifies the **Id** numbers of the breakpoints to enable. The default value is all breakpoints.
140
+
Provide the **Id** by number or in a variable. You can't pipe **Id** numbers to
141
+
`Enable-PSBreakpoint`. To find the **Id** of a breakpoint, use the `Get-PSBreakpoint` cmdlet.
145
142
146
143
```yaml
147
144
Type: Int32[]
148
145
Parameter Sets: Id
149
146
Aliases:
150
147
151
148
Required: True
152
-
Position: 1
153
-
Default value: All breakpoints
149
+
Position: 0
150
+
Default value: None
154
151
Accept pipeline input: True (ByPropertyName)
155
152
Accept wildcard characters: False
156
153
```
157
154
158
155
### -PassThru
159
156
160
-
Returns an object representing the enabled breakpoint.
161
-
By default, this cmdlet does not generate any output.
157
+
Returns an object representing the breakpoint being enabled. By default, this cmdlet doesn't
158
+
generate any output.
162
159
163
160
```yaml
164
161
Type: SwitchParameter
@@ -167,7 +164,7 @@ Aliases:
167
164
168
165
Required: False
169
166
Position: Named
170
-
Default value: False
167
+
Default value: None
171
168
Accept pipeline input: False
172
169
Accept wildcard characters: False
173
170
```
@@ -183,15 +180,14 @@ Aliases: cf
183
180
184
181
Required: False
185
182
Position: Named
186
-
Default value: None
183
+
Default value: False
187
184
Accept pipeline input: False
188
185
Accept wildcard characters: False
189
186
```
190
187
191
188
### -WhatIf
192
189
193
-
Shows what would happen if the cmdlet runs.
194
-
The cmdlet is not run.
190
+
Shows what would happen if the cmdlet runs. The cmdlet isn't run.
195
191
196
192
```yaml
197
193
Type: SwitchParameter
@@ -200,34 +196,37 @@ Aliases: wi
200
196
201
197
Required: False
202
198
Position: Named
203
-
Default value: None
199
+
Default value: False
204
200
Accept pipeline input: False
205
201
Accept wildcard characters: False
206
202
```
207
203
208
204
### CommonParameters
209
205
210
-
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).
206
+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
211
209
212
210
## INPUTS
213
211
214
212
### System.Management.Automation.Breakpoint
215
213
216
-
You can pipe a breakpoint object to Enable-PSBreakpoint.
214
+
You can pipe a breakpoint object to `Enable-PSBreakpoint`.
217
215
218
216
## OUTPUTS
219
217
220
218
### None or System.Management.Automation.Breakpoint
221
219
222
-
When you use the PassThru parameter, Enable-PSBreakpoint returns a breakpoint object that represent that breakpoint that was enabled.
223
-
Otherwise, this cmdlet does not generate any output.
220
+
When you use the **PassThru** parameter, `Enable-PSBreakpoint` returns a breakpoint object that represents that breakpoint that was enabled. Otherwise, this cmdlet doesn't generate any output.
224
221
225
222
## NOTES
226
223
227
-
- 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.
224
+
- The `Enable-PSBreakpoint` cmdlet doesn't generate an error if you try to enable a breakpoint that
225
+
is already enabled. As such, you can enable all breakpoints without error, even when only a few
226
+
are disabled.
228
227
229
-
Breakpoints are enabled when you create them by using the Set-PSBreakpoint cmdlet.
230
-
You do not need to enable newly created breakpoints.
228
+
- Breakpoints are enabled when you create them by using the `Set-PSBreakpoint` cmdlet. You don't
229
+
need to enable newly created breakpoints.
231
230
232
231
## RELATED LINKS
233
232
@@ -240,7 +239,3 @@ You do not need to enable newly created breakpoints.
0 commit comments