From fab1e6629ae84c61e3d19d4b2ebfb660183258c5 Mon Sep 17 00:00:00 2001 From: SteveL-MSFT Date: Mon, 5 Jun 2017 11:24:52 -0700 Subject: [PATCH] ignore failure on GetConsoleFontInfoEx() api call which is available on ServerCore but fails running in container to allow PSReadline to continue --- src/Microsoft.PowerShell.PSReadLine/ConsoleLib.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Microsoft.PowerShell.PSReadLine/ConsoleLib.cs b/src/Microsoft.PowerShell.PSReadLine/ConsoleLib.cs index 98b9eb66586..4451f95a1f3 100644 --- a/src/Microsoft.PowerShell.PSReadLine/ConsoleLib.cs +++ b/src/Microsoft.PowerShell.PSReadLine/ConsoleLib.cs @@ -727,9 +727,7 @@ internal static CONSOLE_FONT_INFO_EX GetConsoleFontInfo(SafeFileHandle consoleHa if (result == false) { - int err = Marshal.GetLastWin32Error(); - Win32Exception innerException = new Win32Exception(err); - throw new Exception("Failed to get console font information.", innerException); + _getCurrentConsoleFontExApiAvailable = false; // api not supported on ServerCore } return fontInfo; }