diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj index c94c51b1fa4..643abeaf98b 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -14,7 +14,7 @@ - + diff --git a/src/System.Management.Automation/utils/Telemetry.cs b/src/System.Management.Automation/utils/Telemetry.cs index ecd1a126aee..8551edfa863 100644 --- a/src/System.Management.Automation/utils/Telemetry.cs +++ b/src/System.Management.Automation/utils/Telemetry.cs @@ -102,11 +102,13 @@ static ApplicationInsightsTelemetry() CanSendTelemetry = !Utils.GetOptOutEnvVariableAsBool(name: _telemetryOptoutEnvVar, defaultValue: false); if (CanSendTelemetry) { - s_telemetryClient = new TelemetryClient(); - TelemetryConfiguration.Active.InstrumentationKey = _psCoreTelemetryKey; + TelemetryConfiguration configuration = TelemetryConfiguration.CreateDefault(); + configuration.InstrumentationKey = _psCoreTelemetryKey; // Set this to true to reduce latency during development - TelemetryConfiguration.Active.TelemetryChannel.DeveloperMode = false; + configuration.TelemetryChannel.DeveloperMode = false; + + s_telemetryClient = new TelemetryClient(configuration); s_sessionId = Guid.NewGuid().ToString(); // use a hashset when looking for module names, it should be quicker than a string comparison