@@ -119,7 +119,7 @@ public string HashMacAddress
119
119
try
120
120
{
121
121
var macAddress = _networkHelper . GetMACAddress ( ) ;
122
- _hashMacAddress = string . IsNullOrWhiteSpace ( macAddress )
122
+ _hashMacAddress = string . IsNullOrWhiteSpace ( macAddress )
123
123
? null : GenerateSha256HashString ( macAddress ) ? . Replace ( "-" , string . Empty ) ? . ToLowerInvariant ( ) ;
124
124
}
125
125
catch
@@ -255,7 +255,7 @@ private void LogExceptionEvent(AzurePSQoSEvent qos)
255
255
Dictionary < string , string > eventProperties = new Dictionary < string , string > ( ) ;
256
256
LoadTelemetryClientContext ( qos , client . Context ) ;
257
257
PopulatePropertiesFromQos ( qos , eventProperties ) ;
258
- // qos.Exception contains exception message which may contain Users specific data.
258
+ // qos.Exception contains exception message which may contain Users specific data.
259
259
// We should not collect users specific data.
260
260
eventProperties . Add ( "Message" , "Message removed due to PII." ) ;
261
261
eventProperties . Add ( "StackTrace" , qos . Exception . StackTrace ) ;
@@ -401,7 +401,7 @@ private void PopulatePropertiesFromQos(AzurePSQoSEvent qos, IDictionary<string,
401
401
? qos . Exception . Data [ AzurePSErrorDataKeys . ErrorKindKey ] . ToString ( )
402
402
: null ;
403
403
cloudErrorCode = ( string ) qos . Exception . Data [ AzurePSErrorDataKeys . CloudErrorCodeKey ] ;
404
- // For the time being, we consider ResourceNotFound and ResourceGroupNotFound as user's input error.
404
+ // For the time being, we consider ResourceNotFound and ResourceGroupNotFound as user's input error.
405
405
// We are considering if ResourceNotFound should be false positive error.
406
406
if ( ( "ResourceNotFound" . Equals ( cloudErrorCode ) || "ResourceGroupNotFound" . Equals ( cloudErrorCode ) )
407
407
&& existingErrorKind != ErrorKind . FalseError )
@@ -413,7 +413,7 @@ private void PopulatePropertiesFromQos(AzurePSQoSEvent qos, IDictionary<string,
413
413
StringBuilder sb = new StringBuilder ( ) ;
414
414
foreach ( var key in qos . Exception . Data ? . Keys )
415
415
{
416
- if ( AzurePSErrorDataKeys . IsKeyPredefined ( key . ToString ( ) )
416
+ if ( AzurePSErrorDataKeys . IsKeyPredefined ( key . ToString ( ) )
417
417
&& ! AzurePSErrorDataKeys . HttpStatusCode . Equals ( key ) )
418
418
{
419
419
if ( sb . Length > 0 )
@@ -481,8 +481,8 @@ private static string ConvertFrameToString(System.Diagnostics.StackFrame frame)
481
481
482
482
public bool IsMetricTermAccepted ( )
483
483
{
484
- return _profile != null
485
- && _profile . EnableAzureDataCollection . HasValue
484
+ return _profile != null
485
+ && _profile . EnableAzureDataCollection . HasValue
486
486
&& _profile . EnableAzureDataCollection . Value ;
487
487
}
488
488
@@ -604,6 +604,12 @@ public class AzurePSQoSEvent
604
604
public string TenantId { get ; set ; }
605
605
public bool SurveyPrompted { get ; set ; }
606
606
607
+ /// <summary>
608
+ /// Appear in certain resource creation commands like New-AzVM. See RegionalRecommender (PS repo).
609
+ /// Represent the recommended region if we do have recommendation.
610
+ /// </summary>
611
+ public string DisplayRegionIdentified { get ; set ; }
612
+
607
613
public string ParameterSetName { get ; set ; }
608
614
public string InvocationName { get ; set ; }
609
615
public Dictionary < string , string > CustomProperties { get ; private set ; }
@@ -637,8 +643,8 @@ public void FinishQosEvent()
637
643
public override string ToString ( )
638
644
{
639
645
StringBuilder sb = new StringBuilder ( "AzureQoSEvent: " ) ;
640
- if ( ShowTelemetry )
641
- {
646
+ if ( ShowTelemetry )
647
+ {
642
648
foreach ( PropertyDescriptor descriptor in TypeDescriptor . GetProperties ( ( this ) ) )
643
649
{
644
650
string name = descriptor . Name ;
@@ -652,7 +658,7 @@ public override string ToString()
652
658
{
653
659
sb = sb . Append ( $ " Module: { ModuleName } :{ ModuleVersion } ; CommandName: { CommandName } ; PSVersion: { PSVersion } ") ;
654
660
}
655
-
661
+
656
662
sb . Append ( $ "; IsSuccess: { IsSuccess } ; Duration: { Duration } ") ;
657
663
658
664
if ( Exception != null )
0 commit comments