File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
src/Common/Commands.Common Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -234,7 +234,7 @@ protected void PromptForDataCollectionProfileIfNotExists()
234
234
// Initialize it from the environment variable or profile file.
235
235
InitializeDataCollectionProfile ( ) ;
236
236
237
- if ( ! _dataCollectionProfile . EnableAzureDataCollection . HasValue )
237
+ if ( GeneralUtilities . CheckIfInteractive ( ) && ! _dataCollectionProfile . EnableAzureDataCollection . HasValue )
238
238
{
239
239
WriteWarning ( Resources . DataCollectionPrompt ) ;
240
240
Original file line number Diff line number Diff line change @@ -430,5 +430,14 @@ public static void EnsureDefaultProfileDirectoryExists()
430
430
AzureSession . DataStore . CreateDirectory ( AzureSession . ProfileDirectory ) ;
431
431
}
432
432
}
433
+
434
+ /// <summary>
435
+ /// Check if the PS program is run in interactive mode.
436
+ /// </summary>
437
+ public static bool CheckIfInteractive ( )
438
+ {
439
+ var arguments = Environment . GetCommandLineArgs ( ) ;
440
+ return arguments . Any ( s => ! string . Equals ( s , "-noninteractive" ) ) ;
441
+ }
433
442
}
434
443
}
You can’t perform that action at this time.
0 commit comments