File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/Common/Commands.Common Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -227,10 +227,15 @@ protected void SaveDataCollectionProfile()
227227
228228 protected bool CheckIfInteractive ( )
229229 {
230+ if ( this . Host == null || this . Host . UI == null || this . Host . UI . RawUI == null )
231+ {
232+ return false ;
233+ }
234+
230235 bool interactive = true ;
231236 try
232237 {
233- var test = this . Host . UI . RawUI . CursorSize ;
238+ var test = this . Host . UI . RawUI . KeyAvailable ;
234239 }
235240 catch ( HostException ex )
236241 {
@@ -298,9 +303,9 @@ protected void PromptForDataCollectionProfileIfNotExists()
298303 /// </summary>
299304 protected override void BeginProcessing ( )
300305 {
306+ InitializeProfile ( ) ;
301307 PromptForDataCollectionProfileIfNotExists ( ) ;
302308
303- InitializeProfile ( ) ;
304309 if ( string . IsNullOrEmpty ( ParameterSetName ) )
305310 {
306311 WriteDebugWithTimestamp ( string . Format ( Resources . BeginProcessingWithoutParameterSetLog , this . GetType ( ) . Name ) ) ;
You can’t perform that action at this time.
0 commit comments