Blame SOURCES/sdk-telemetry-optout.patch

7c038d
diff --git a/src/Cli/dotnet/Program.cs b/src/Cli/dotnet/Program.cs
7c038d
index de1ebb9e6..6bbf479de 100644
7c038d
--- a/src/Cli/dotnet/Program.cs
7c038d
+++ b/src/Cli/dotnet/Program.cs
7c038d
@@ -28,6 +28,13 @@ public class Program
7c038d
 
7c038d
         public static int Main(string[] args)
7c038d
         {
7c038d
+            // opt out of telemetry by default if the env var is unset
7c038d
+            string telemetryValue = Environment.GetEnvironmentVariable("DOTNET_CLI_TELEMETRY_OPTOUT");
7c038d
+            if (String.IsNullOrEmpty(telemetryValue))
7c038d
+            {
7c038d
+                Environment.SetEnvironmentVariable("DOTNET_CLI_TELEMETRY_OPTOUT", "1");
7c038d
+            }
7c038d
+
7c038d
             DebugHelper.HandleDebugSwitch(ref args);
7c038d
 
385f53
             // Capture the current timestamp to calculate the host overhead.