Skip to content

Commit

Permalink
Merge pull request #2438 from jackpoz/fix/AzureAutomationException
Browse files Browse the repository at this point in the history
Fix exception when writing messages
  • Loading branch information
gautamdsheth authored Oct 10, 2022
2 parents acd69f7 + 31c0134 commit 5456a36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Commands/Utilities/CmdletMessageWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ internal static void WriteFormattedWarning(PSCmdlet cmdlet, string message)

internal static void WriteFormattedMessage(PSCmdlet cmdlet, Message message)
{
if (cmdlet.Host.Name == "ConsoleHost")
if (cmdlet.Host.Name == "ConsoleHost" && cmdlet.Host.UI.RawUI.MaxWindowSize.Width > 8)
{
var messageLines = new List<string>();
messageLines.AddRange(message.Text.Split(new[] { '\n' }));
Expand Down

0 comments on commit 5456a36

Please sign in to comment.