diff --git a/src/dotnet-core-uninstall/Shared/Commands/UninstallCommandExec.cs b/src/dotnet-core-uninstall/Shared/Commands/UninstallCommandExec.cs index 612e724d..5eddfffe 100644 --- a/src/dotnet-core-uninstall/Shared/Commands/UninstallCommandExec.cs +++ b/src/dotnet-core-uninstall/Shared/Commands/UninstallCommandExec.cs @@ -193,7 +193,7 @@ public static bool AskItAndReturnUserAnswer(IDictionary bundles, Console.Write(string.Format(RuntimeInfo.RunningOnWindows ? LocalizableStrings.WindowsConfirmationPromptOutputFormat : LocalizableStrings.MacConfirmationPromptOutputFormat, displayNames)); - var response = userResponse?.ToUpper() ?? Console.ReadKey().KeyChar.ToString().ToUpper(); + var response = (userResponse ?? Console.ReadLine()).ToUpper(); if (response.Equals("Y")) { @@ -216,13 +216,13 @@ public static bool AskWithWarningsForRequiredBundles(IDictionary LocalizableStrings.MacRequiredBundleConfirmationPromptOutputFormat, pair.Key.DisplayName, pair.Value)); Console.ResetColor(); - var response = userResponse?.ToUpper() ?? Console.ReadKey().KeyChar.ToString().ToUpper(); + var response = (userResponse ?? Console.ReadLine()).ToUpper(); if (response.Equals("N")) { return false; } - if (!(response.Equals("Y") || response.Equals("YES"))) + if (!response.Equals("Y")) { throw new ConfirmationPromptInvalidException(); }