@@ -324,12 +324,12 @@ protected virtual void SetupHttpClientPipeline()
324
324
AzureSession . Instance . ClientFactory . AddUserAgent ( ModuleName , this . ModuleVersion ) ;
325
325
try {
326
326
string hostEnv = AzurePSCmdlet . getEnvUserAgent ( ) ;
327
- if ( ! String . IsNullOrWhiteSpace ( hostEnv ) )
327
+ if ( ! String . IsNullOrWhiteSpace ( hostEnv ) )
328
328
{
329
329
AzureSession . Instance . ClientFactory . AddUserAgent ( hostEnv ) ;
330
330
}
331
- }
332
- catch ( Exception )
331
+ }
332
+ catch ( Exception )
333
333
{
334
334
// ignore if it failed.
335
335
}
@@ -409,7 +409,7 @@ protected override void BeginProcessing()
409
409
private void WriteBreakingChangeOrPreviewMessage ( )
410
410
{
411
411
if ( AzureSession . Instance . TryGetComponent < IConfigManager > ( nameof ( IConfigManager ) , out var configManager )
412
- && configManager . GetConfigValue < bool > ( ConfigKeysForCommon . DisplayBreakingChangeWarning ) )
412
+ && configManager . GetConfigValue < bool > ( ConfigKeysForCommon . DisplayBreakingChangeWarning , MyInvocation ) )
413
413
{
414
414
BreakingChangeAttributeHelper . ProcessCustomAttributesAtRuntime ( this . GetType ( ) , this . MyInvocation , WriteWarning ) ;
415
415
@@ -457,7 +457,7 @@ protected override void EndProcessing()
457
457
if ( MetricHelper . IsCalledByUser ( )
458
458
&& SurveyHelper . GetInstance ( ) . ShouldPromptAzSurvey ( )
459
459
&& ( AzureSession . Instance . TryGetComponent < IConfigManager > ( nameof ( IConfigManager ) , out var configManager )
460
- && ! configManager . GetConfigValue < bool > ( ConfigKeysForCommon . EnableInterceptSurvey ) . Equals ( false ) ) )
460
+ && ! configManager . GetConfigValue < bool > ( ConfigKeysForCommon . EnableInterceptSurvey , MyInvocation ) . Equals ( false ) ) )
461
461
{
462
462
WriteSurvey ( ) ;
463
463
if ( _qosEvent != null )
@@ -516,7 +516,7 @@ protected bool IsVerbose()
516
516
517
517
protected void WriteSurvey ( )
518
518
{
519
- // Using color same with Azure brand event.
519
+ // Using color same with Azure brand event.
520
520
// Using Ansi Code to control font color(97(Bold White)) and background color(0;120;212(RGB))
521
521
string ansiCodePrefix = "\u001b [97;48;2;0;120;212m" ;
522
522
// using '[k' for erase in line. '[0m' to ending ansi code
@@ -540,7 +540,7 @@ protected void WriteSurvey()
540
540
}
541
541
base . WriteError ( errorRecord ) ;
542
542
if ( AzureSession . Instance . TryGetComponent < IConfigManager > ( nameof ( IConfigManager ) , out var configManager )
543
- && configManager . GetConfigValue < bool > ( ConfigKeysForCommon . DisplayBreakingChangeWarning ) )
543
+ && configManager . GetConfigValue < bool > ( ConfigKeysForCommon . DisplayBreakingChangeWarning , MyInvocation ) )
544
544
{
545
545
PreviewAttributeHelper . ProcessCustomAttributesAtRuntime ( this . GetType ( ) , this . MyInvocation , WriteWarning ) ;
546
546
}
@@ -863,7 +863,7 @@ private void RecordDebugMessages()
863
863
private bool ShouldRecordDebugMessages ( )
864
864
{
865
865
return AzureSession . Instance . TryGetComponent < IConfigManager > ( nameof ( IConfigManager ) , out var configManager )
866
- && configManager . GetConfigValue < bool > ( ConfigKeysForCommon . EnableErrorRecordsPersistence )
866
+ && configManager . GetConfigValue < bool > ( ConfigKeysForCommon . EnableErrorRecordsPersistence , MyInvocation )
867
867
&& IsDataCollectionAllowed ( ) ;
868
868
}
869
869
0 commit comments