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()
227
227
228
228
protected bool CheckIfInteractive ( )
229
229
{
230
+ if ( this . Host == null || this . Host . UI == null || this . Host . UI . RawUI == null )
231
+ {
232
+ return false ;
233
+ }
234
+
230
235
bool interactive = true ;
231
236
try
232
237
{
233
- var test = this . Host . UI . RawUI . CursorSize ;
238
+ var test = this . Host . UI . RawUI . KeyAvailable ;
234
239
}
235
240
catch ( HostException ex )
236
241
{
@@ -298,9 +303,9 @@ protected void PromptForDataCollectionProfileIfNotExists()
298
303
/// </summary>
299
304
protected override void BeginProcessing ( )
300
305
{
306
+ InitializeProfile ( ) ;
301
307
PromptForDataCollectionProfileIfNotExists ( ) ;
302
308
303
- InitializeProfile ( ) ;
304
309
if ( string . IsNullOrEmpty ( ParameterSetName ) )
305
310
{
306
311
WriteDebugWithTimestamp ( string . Format ( Resources . BeginProcessingWithoutParameterSetLog , this . GetType ( ) . Name ) ) ;
You can’t perform that action at this time.
0 commit comments