Skip to content

Commit a54f7dc

Browse files
author
Daniel Llewellyn
committed
Refactor TelemetryOptout constant
Rename the constant to to better reflect its purpose.
1 parent c3e3663 commit a54f7dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Microsoft.PowerShell.ConsoleHost/host/msh/Telemetry.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ internal static class ApplicationInsightsTelemetry
2121
// The name of the file by when present in $PSHOME will enable telemetry.
2222
// If this file is not present, no telemetry will be sent.
2323
private const string TelemetrySemaphoreFilename = "DELETE_ME_TO_DISABLE_CONSOLEHOST_TELEMETRY";
24-
private const string TelemetryOptout = "POWERSHELL_TELEMETRY_OPTOUT";
24+
private const string TelemetryOptoutEnvVar = "POWERSHELL_TELEMETRY_OPTOUT";
2525

2626
// The path to the semaphore file which enables telemetry
2727
private static string TelemetrySemaphoreFilePath = Path.Combine(
@@ -73,7 +73,7 @@ private static void SendTelemetry(string eventName, Dictionary<string,string>pay
7373
try
7474
{
7575
// if the semaphore file exists, try to send telemetry
76-
var Enabled = Utils.NativeFileExists(TelemetrySemaphoreFilePath) && !GetEnvironmentVariableAsBool(TelemetryOptout, false);
76+
var Enabled = Utils.NativeFileExists(TelemetrySemaphoreFilePath) && !GetEnvironmentVariableAsBool(TelemetryOptoutEnvVar, false);
7777

7878
if ( ! Enabled )
7979
{

0 commit comments

Comments
 (0)