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:
parent
299a8abb56
commit
22a3a896ee
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue