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
1 changed files with 1 additions and 3 deletions
|
@ -727,9 +727,7 @@ namespace Microsoft.PowerShell.Internal
|
||||||
|
|
||||||
if (result == false)
|
if (result == false)
|
||||||
{
|
{
|
||||||
int err = Marshal.GetLastWin32Error();
|
_getCurrentConsoleFontExApiAvailable = false; // api not supported on ServerCore
|
||||||
Win32Exception innerException = new Win32Exception(err);
|
|
||||||
throw new Exception("Failed to get console font information.", innerException);
|
|
||||||
}
|
}
|
||||||
return fontInfo;
|
return fontInfo;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue