Blame SOURCES/sdk-telemetry-optout.patch

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