Silently ignore failure on GetConsoleFontInfoEx() api call (#3937)

The api is available on ServerCore but fails (returns false) running in container.
Silently ignoring the failure allows PSReadline to work.
This commit is contained in:
Steve Lee 2017-06-05 13:17:26 -07:00 committed by Jason Shirk
parent 299a8abb56
commit 22a3a896ee

View file

@ -727,9 +727,7 @@ namespace Microsoft.PowerShell.Internal
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;
}