question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extension crashes with ParseError: The '<' operator is reserved for future use

See original GitHub issue

Issue Description

Whenever I open a PowerShell file (ps1 / psm1) the extension crashes like so:

vscode-powershell-crash vscode-powershell-error vscode-powershell-session-error image

I tried the following to no effect:

  • uninstall + reinstall
  • preview version
  • Restart vscode
  • Restart computer

Attached Logs

6/23/2020 5:30:07 PM [NORMAL] - Visual Studio Code v1.46.1 64-bit
6/23/2020 5:30:07 PM [NORMAL] - PowerShell Extension v2020.6.0
6/23/2020 5:30:07 PM [NORMAL] - Operating System: Windows 64-bit
6/23/2020 5:30:07 PM [NORMAL] - Language server starting --
6/23/2020 5:30:07 PM [NORMAL] -     PowerShell executable: C:\Users\ohad1\.dotnet\tools\pwsh.exe
6/23/2020 5:30:07 PM [NORMAL] -     PowerShell args: -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command Import-Module 'c:\Users\ohad1\.vscode\extensions\ms-vscode.powershell-2020.6.0\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2020.6.0' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users\ohad1\.vscode\extensions\ms-vscode.powershell-2020.6.0\modules' -EnableConsoleRepl -StartupBanner "=====> PowerShell Integrated Console v2020.6.0 <=====
" -LogLevel 'Normal' -LogPath 'c:\Users\ohad1\.vscode\extensions\ms-vscode.powershell-2020.6.0\logs\1592922607-427b8a15-52cc-47ce-b42c-273cfda30f671592922585773\EditorServices.log' -SessionDetailsPath 'c:\Users\ohad1\.vscode\extensions\ms-vscode.powershell-2020.6.0\sessions\PSES-VSCode-22388-563996' -FeatureFlags @() 
6/23/2020 5:30:07 PM [NORMAL] -     PowerShell Editor Services args: Import-Module 'c:\Users\ohad1\.vscode\extensions\ms-vscode.powershell-2020.6.0\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2020.6.0' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users\ohad1\.vscode\extensions\ms-vscode.powershell-2020.6.0\modules' -EnableConsoleRepl -StartupBanner "=====> PowerShell Integrated Console v2020.6.0 <=====
" -LogLevel 'Normal' -LogPath 'c:\Users\ohad1\.vscode\extensions\ms-vscode.powershell-2020.6.0\logs\1592922607-427b8a15-52cc-47ce-b42c-273cfda30f671592922585773\EditorServices.log' -SessionDetailsPath 'c:\Users\ohad1\.vscode\extensions\ms-vscode.powershell-2020.6.0\sessions\PSES-VSCode-22388-563996' -FeatureFlags @() 
6/23/2020 5:30:07 PM [NORMAL] - pwsh.exe started.
6/23/2020 5:30:07 PM [NORMAL] - Waiting for session file
6/23/2020 5:34:08 PM [NORMAL] - Timed out waiting for session file to appear.
6/23/2020 5:34:08 PM [NORMAL] - Language server startup failed.
6/23/2020 5:34:08 PM [ERROR] - The language service could not be started: 
6/23/2020 5:34:08 PM [ERROR] - Error: Timed out waiting for session file to appear.

It looks like the < in the StartupBanner is causing the issue

Environment Information

Visual Studio Code

Name Version
Operating System Windows_NT x64 10.0.18363
VSCode 1.46.1
PowerShell Extension Version 2020.6.0

PowerShell Information

PS C:\> $psEditor.EditorServicesVersion
PS C:\> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.18362.752
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.18362.752
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

I don’t know why 5.1 is loaded - I have the latest PowerShell Core (7.0.02) installed and working (e.g. in Windows Terminal).

Visual Studio Code Extensions

Visual Studio Code Extensions(Click to Expand)
Extension Author Version
azure-account ms-vscode 0.8.11
azurerm-vscode-tools msazurermtools 0.11.0
ginfuru-vscode-jekyll-syntax ginfuru 0.1.1
html-preview-vscode tht13 0.2.5
language-liquid neilding 0.1.1
mssql ms-mssql 1.9.0
powershell ms-vscode 2020.6.0
remote-wsl ms-vscode-remote 0.44.4
team ms-vsts 1.161.0
vscode-aks-tools ms-kubernetes-tools 0.0.6
vscode-docker ms-azuretools 1.3.1
vscode-dotnet-runtime ms-dotnettools 0.1.2
vscode-kubernetes-tools ms-kubernetes-tools 1.2.1
vscode-yaml redhat 0.8.0
xml DotJoshJohnson 2.5.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:20 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ohadschncommented, Jun 26, 2020

Thanks, I can confirm .NET tool uninstall + install regular PS MSI works! Sure is good enough for me, but I do like the global tool approach because it’s basically a package manager - not crazy about going off to download MSIs every time a new version comes out… When WinGet is GA I guess that won’t be an issue though (assuming this behavior doesn’t reproduce there of course).

As for my setup, pretty straightforward - display language is English, preferred language it English (I do have Hebrew installed alongside it but it never caused any issue AFAIK). English keyboard layout is standard US QWERTY…

1reaction
ohadschncommented, Jun 14, 2021

@andschwa looks good, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

The '<' operator is reserved for future use - Stack Overflow
full is a script that mimics command line inputs to test_cfdp.exe. However, I get the following error: The '<' operator is reserved for...
Read more >
Why do I get this error? The '<' operator is reserved for future use
When I try to get some numbers from a .txt for a program using "name_of_program < data_from_file" in the terminal in visual studio...
Read more >
How to check Event logs with PowerShell - Get-EventLog ...
In this article, I will show you how to use PowerShell and Get-EventLog to perform some Event Log magic. But first, a few...
Read more >
2 Server Error Message Reference - MySQL :: Developer Zone
Message: Table '%s' uses an extension that doesn't exist in this MySQL version ... Message: The parameter network_namespace is reserved for future use....
Read more >
Pro Windows PowerShell - Springer Link
All shells have the >, >>, and < operators reserved for command output and input ... our pipeline and store them for future...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found