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
4040
4141 public ConcurrentQueue < string > DebugMessages { get ; private set ; }
4242
43+ protected static ConcurrentQueue < string > InitializationWarnings { get ; set ; } = new ConcurrentQueue < string > ( ) ;
44+
4345 private RecordingTracingInterceptor _httpTracingInterceptor ;
4446 private object lockObject = new object ( ) ;
4547 private AzurePSDataCollectionProfile _cachedProfile = null ;
@@ -341,6 +343,7 @@ protected virtual void TearDownHttpClientPipeline()
341343 /// </summary>
342344 protected override void BeginProcessing ( )
343345 {
346+ FlushInitializationWarnings ( ) ;
344347 SessionState = base . SessionState ;
345348 var profile = _dataCollectionProfile ;
346349 //TODO: Inject from CI server
@@ -542,6 +545,20 @@ private void FlushDebugMessages(bool record = false)
542545 }
543546 }
544547
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+
545562 protected abstract void InitializeQosEvent ( ) ;
546563
547564 private void RecordDebugMessages ( )
You can’t perform that action at this time.
0 commit comments