Skip to content

Commit

Permalink
Merge pull request #662 from dahlbyk/rkeithhill/set-console-mode-psco…
Browse files Browse the repository at this point in the history
…re-windows

Even in PS Core on Windows, we need to set the console mode
  • Loading branch information
rkeithhill authored Feb 18, 2019
2 parents 688ba21 + 4eb0563 commit c5dd274
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/ConsoleMode.ps1
Original file line number Diff line number Diff line change
@@ -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()
Expand Down

0 comments on commit c5dd274

Please sign in to comment.