Blame SOURCES/sdk-telemetry-optout.patch

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