diff --git a/src/ConsoleMode.ps1 b/src/ConsoleMode.ps1 index 7808e19d5..b94602ed6 100644 --- a/src/ConsoleMode.ps1 +++ b/src/ConsoleMode.ps1 @@ -1,10 +1,7 @@ # Hack! https://gist.github.com/lzybkr/f2059cb2ee8d0c13c65ab933b75e998c # Always skip setting the console mode on non-Windows platforms. -# On Windows, *if* we are running in PowerShell Core *and* the host is the "ConsoleHost", -# rely on PS Core to manage the console mode. This speeds up module import on standard -# PowerShell Core on Windows. -if (($IsWindows -eq $false) -or (($PSVersionTable.PSVersion.Major -ge 6) -and ($host.Name -eq 'ConsoleHost'))) { +if (($PSVersionTable.PSVersion.Major -ge 6) -and !$IsWindows) { function Set-ConsoleMode { [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")] param()