diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs index c6deb0e0d3e..a55de175798 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs @@ -1043,7 +1043,7 @@ private void ParseFormat(string[] args, ref int i, ref Serialization.DataFormat foreach (string s in Enum.GetNames(typeof(Serialization.DataFormat))) { sb.Append(s); - sb.Append(ConsoleHostUserInterface.Crlf); + sb.Append(Environment.NewLine); } ++i; diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs index f925dbd7f73..6ae6eea1e54 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs @@ -2562,7 +2562,7 @@ internal static void WriteConsole(ConsoleHandle consoleHandle, ReadOnlySpan outBufferLine = stackalloc char[outBuffer.Length + endOfLineLength]; outBuffer.CopyTo(outBufferLine); diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs index 53431f42d92..4a575da7f4b 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs @@ -712,7 +712,7 @@ private void WriteImpl(string value, bool newLine) if (newLine) { - _parent.OutputSerializer.Serialize(Crlf); + _parent.OutputSerializer.Serialize(Environment.NewLine); } } else @@ -1152,7 +1152,7 @@ internal string WrapToCurrentWindowWidth(string text) sb.Append(s); if (++count != lines.Count) { - sb.Append(Crlf); + sb.Append(Environment.NewLine); } } @@ -1344,7 +1344,7 @@ public override void WriteErrorLine(string value) { Dbg.Assert(writer == _parent.ErrorSerializer.textWriter, "writers should be the same"); - _parent.ErrorSerializer.Serialize(value + Crlf); + _parent.ErrorSerializer.Serialize(value + Environment.NewLine); } else { @@ -1612,7 +1612,7 @@ private string ReadLineFromConsole(bool endOnTab, string initialContent, bool ca #if UNIX if (keyInfo.Key == ConsoleKey.Enter) #else - if (s.EndsWith(Crlf, StringComparison.Ordinal)) + if (s.EndsWith(Environment.NewLine, StringComparison.Ordinal)) #endif { result = ReadLineResult.endedOnEnter; @@ -1620,7 +1620,7 @@ private string ReadLineFromConsole(bool endOnTab, string initialContent, bool ca // We're intercepting characters, so we need to echo the newline Console.Out.WriteLine(); #else - s = s.Remove(s.Length - Crlf.Length); + s = s.Remove(s.Length - Environment.NewLine.Length); #endif break; }