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
206206 }
207207 private bool saveDscDependency ;
208208#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
209219 #endregion Parameters
210220
211221 #region Overrides
@@ -216,6 +226,19 @@ public SwitchParameter SaveDscDependency
216226 protected override void BeginProcessing ( )
217227 {
218228 // 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
219242 Helper . Instance = new Helper (
220243 SessionState . InvokeCommand ,
221244 this ) ;
You can’t perform that action at this time.
0 commit comments