GeezerVison is showing github.com — Refactor TelemetryOptout constant · PowerShell/PowerShell@a54f7dc
File tree
Expand file treeCollapse file tree
Open diff view settings
src/Microsoft.PowerShell.ConsoleHost/host/msh
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: src/Microsoft.PowerShell.ConsoleHost/host/msh/Telemetry.cs +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -21,7 +21,7 @@ internal static class ApplicationInsightsTelemetry |
21 | 21 | // The name of the file by when present in $PSHOME will enable telemetry. |
22 | 22 | // If this file is not present, no telemetry will be sent. |
23 | 23 | 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"; |
25 | 25 |
|
26 | 26 | // The path to the semaphore file which enables telemetry |
27 | 27 | private static string TelemetrySemaphoreFilePath = Path.Combine( |
@@ -73,7 +73,7 @@ private static void SendTelemetry(string eventName, Dictionary<string,string>pay |
73 | 73 | try |
74 | 74 | { |
75 | 75 | // 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); |
77 | 77 |
|
78 | 78 | if ( ! Enabled ) |
79 | 79 | { |
|