diff --git a/src/chocolatey/infrastructure/powershell/PoshHostUserInterface.cs b/src/chocolatey/infrastructure/powershell/PoshHostUserInterface.cs index 191070e1a2..fa2bffe2bf 100644 --- a/src/chocolatey/infrastructure/powershell/PoshHostUserInterface.cs +++ b/src/chocolatey/infrastructure/powershell/PoshHostUserInterface.cs @@ -198,7 +198,8 @@ private static string[] get_hotkey_and_label(string input) public override int PromptForChoice(string caption, string message, Collection choices, int defaultChoice) { - this.Log().Warn(caption.escape_curly_braces()); + if (!string.IsNullOrWhiteSpace(caption)) this.Log().Warn(caption.escape_curly_braces()); + if (!string.IsNullOrWhiteSpace(message)) this.Log().Warn(ChocolateyLoggers.Important, message.escape_curly_braces()); string[,] promptData = build_hotkeys_and_plain_labels(choices); @@ -208,14 +209,14 @@ public override int PromptForChoice(string caption, string message, Collection {1} ", + "[{0}] {1} ", promptData[0, element], promptData[1, element])); } choicePrompt.Append(String.Format( CultureInfo.CurrentCulture, - "[Default is ({0}]", + "(default is \"{0}\")", promptData[0, defaultChoice])); while (true) @@ -255,7 +256,9 @@ public override PSCredential PromptForCredential(string caption, string message, public override PSCredential PromptForCredential(string caption, string message, string userName, string targetName, PSCredentialTypes allowedCredentialTypes, PSCredentialUIOptions options) { - this.Log().Warn(caption.escape_curly_braces()); + if (!string.IsNullOrWhiteSpace(caption)) this.Log().Warn(caption.escape_curly_braces()); + if (!string.IsNullOrWhiteSpace(message)) this.Log().Warn(ChocolateyLoggers.Important, message.escape_curly_braces()); + if (string.IsNullOrWhiteSpace(userName)) { this.Log().Warn("Please provide username:");