File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -206,6 +206,16 @@ public SwitchParameter SaveDscDependency
206
206
}
207
207
private bool saveDscDependency ;
208
208
#endif // !PSV3
209
+
210
+ #if DEBUG
211
+ [ Parameter ( Mandatory = false ) ]
212
+ public SwitchParameter AttachAndDebug
213
+ {
214
+ get { return attachAndDebug ; }
215
+ set { attachAndDebug = value ; }
216
+ }
217
+ private bool attachAndDebug = false ;
218
+ #endif
209
219
#endregion Parameters
210
220
211
221
#region Overrides
@@ -216,6 +226,19 @@ public SwitchParameter SaveDscDependency
216
226
protected override void BeginProcessing ( )
217
227
{
218
228
// Initialize helper
229
+ #if DEBUG
230
+ if ( attachAndDebug )
231
+ {
232
+ if ( System . Diagnostics . Debugger . IsAttached )
233
+ {
234
+ System . Diagnostics . Debugger . Break ( ) ;
235
+ }
236
+ else
237
+ {
238
+ System . Diagnostics . Debugger . Launch ( ) ;
239
+ }
240
+ }
241
+ #endif
219
242
Helper . Instance = new Helper (
220
243
SessionState . InvokeCommand ,
221
244
this ) ;
You can’t perform that action at this time.
0 commit comments