File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ public abstract class AzurePSCmdlet : PSCmdlet, IDisposable
40
40
41
41
public ConcurrentQueue < string > DebugMessages { get ; private set ; }
42
42
43
+ protected static ConcurrentQueue < string > InitializationWarnings { get ; set ; } = new ConcurrentQueue < string > ( ) ;
44
+
43
45
private RecordingTracingInterceptor _httpTracingInterceptor ;
44
46
private object lockObject = new object ( ) ;
45
47
private AzurePSDataCollectionProfile _cachedProfile = null ;
@@ -341,6 +343,7 @@ protected virtual void TearDownHttpClientPipeline()
341
343
/// </summary>
342
344
protected override void BeginProcessing ( )
343
345
{
346
+ FlushInitializationWarnings ( ) ;
344
347
SessionState = base . SessionState ;
345
348
var profile = _dataCollectionProfile ;
346
349
//TODO: Inject from CI server
@@ -542,6 +545,20 @@ private void FlushDebugMessages(bool record = false)
542
545
}
543
546
}
544
547
548
+ public void WriteInitializationWarnings ( string message )
549
+ {
550
+ InitializationWarnings . Enqueue ( message ) ;
551
+ }
552
+
553
+ protected void FlushInitializationWarnings ( )
554
+ {
555
+ string message ;
556
+ while ( InitializationWarnings . TryDequeue ( out message ) )
557
+ {
558
+ base . WriteWarning ( message ) ;
559
+ }
560
+ }
561
+
545
562
protected abstract void InitializeQosEvent ( ) ;
546
563
547
564
private void RecordDebugMessages ( )
You can’t perform that action at this time.
0 commit comments