diff --git a/src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs b/src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs index a737cf1d9..e6f85ca78 100644 --- a/src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs +++ b/src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs @@ -663,7 +663,11 @@ private Task EnableShellIntegrationAsync(CancellationToken cancellationToken) } # Set IsWindows property -Write-Host -NoNewLine ""$([char]0x1b)]633;P;IsWindows=$($IsWindows)`a"" +if ($PSVersionTable.PSVersion -lt ""6.0"") { + [Console]::Write(""$([char]0x1b)]633;P;IsWindows=$true`a"") +} else { + [Console]::Write(""$([char]0x1b)]633;P;IsWindows=$IsWindows`a"") +} # Set always on key handlers which map to default VS Code keybindings function Set-MappedKeyHandler {