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.

PowerShell Preview is Crashing 2019.11.0

See original GitHub issue

Issue Description

I am experiencing a problem with…crashing of extension.

Basically what I did is have an empty .ps1 file. Typed Get-Process to reproduce #2274 ticket, waited. Nothing showed up, pressed enter, and it showed @ as mentioned in #2274 and finally crashed a few seconds later.

I’m opening it as a separate issue as it may be worth try/catch or something. Feel free to close one if it’s the same thing.

Relevant log.

2019-11-04 10:47:28.903 +01:00 [WRN] Runtime exception occurred while executing command:

System.Management.Automation.ParseException: At line:1 char:1
+ @
+ ~
Unrecognized token in source text.
   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
   at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.Invoke[T](IEnumerable input, PSInvocationSettings settings)
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.PowerShell.EditorServices.Services.PowerShellContextService.<ExecuteCommandAsync>d__84`1.MoveNext()
2019-11-04 10:47:28.974 +01:00 [VRB] StartReadLoop called while read loop is already running
2019-11-04 10:47:28.974 +01:00 [VRB] Attempting to execute command(s):

Attached Logs

Follow the instructions in the README about capturing and sending logs.

Environment Information

Visual Studio Code

Name Version
Operating System Windows_NT x64 10.0.17763
VSCode 1.39.2
PowerShell Extension Version 2019.11.0

PowerShell Information

Name Value
PSVersion 5.1.17763.771
PSEdition Desktop
PSCompatibleVersions 1.0 2.0 3.0 4.0 5.0 5.1.17763.771
BuildVersion 10.0.17763.771
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Visual Studio Code Extensions

Visual Studio Code Extensions(Click to Expand)
Extension Author Version
beautify HookyQR 1.5.0
gitlens eamodio 10.1.1
material-icon-theme PKief 3.9.1
open-in-browser techer 2.0.0
powershell-preview ms-vscode 2019.11.0
theme-monokai-pro-vscode monokai 1.1.14
vscode-wakatime WakaTime 2.2.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
PrzemyslawKlyscommented, Nov 4, 2019
0reactions
rjmholtcommented, Nov 4, 2019

So still haven’t worked out where PowerShellContextService.ExecuteCommandAsync() is being called in a way that we don’t handle it, but I do have some good info on the @ problem. Will share in a more specific thread.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Windows PowerShell crashes after flashing with error ...
Here are a few fixes and suggestions: 1] Run System File Checker 2] Troubleshoot .NET Framework 3] Run Windows PowerShell without the default ......
Read more >
PowerShell PowerTip: ISE crashing and auto complete not ...
Have you been having issues with the ISE crashing and not auto completing since windows update 1803? From what I've seen there is...
Read more >
PowerShell Preview - Visual Studio Marketplace
Extension for Visual Studio Code - (Preview) Develop PowerShell modules, commands and scripts in Visual Studio Code!
Read more >
Kindle crashes and broken PowerShell: Something isn't right ...
The PowerShell issue wouldn't be a problem if it weren't incorporated into a cumulative update; affected users could just roll back the broken ......
Read more >
PowerShell crashes on `if ( $? = $false )` - Stack Overflow
Your code is wrong. You are assigning $false to the question mark variable which is a read-only variable. You probably want to replace...
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