diff --git a/src/Cake.Core/Polyfill/ProcessHelper.cs b/src/Cake.Core/Polyfill/ProcessHelper.cs index 299c3b0996..06006b1215 100644 --- a/src/Cake.Core/Polyfill/ProcessHelper.cs +++ b/src/Cake.Core/Polyfill/ProcessHelper.cs @@ -17,7 +17,7 @@ public static void SetEnvironmentVariable(ProcessStartInfo info, string key, str info.Environment[envKey] = value; #else var envKey = info.EnvironmentVariables.Keys.Cast().FirstOrDefault(existingKey => StringComparer.OrdinalIgnoreCase.Equals(existingKey, key)) ?? key; - info.EnvironmentVariables[key] = value; + info.EnvironmentVariables[envKey] = value; #endif } }