Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Aborting an "unclosed" powershell command in Visual Studio Nuget Package manager console

Tags:

I accidently issued an invalid PowerShell command in the NuGet Package Manager console and locked the console.
The command was

PM> Get-Project -all | Where { $_.ProjectName -imatch "GPEC.Personne } 

then the console displayed >> as prompt and I was unable to leave this mode. Closing and reopening the console did not help. (Had to restart VS).
Is there a way to gracefully cancel a wrong command in this case and return to the standard PM> prompt?

Thanks in advance. Philippe

like image 521
PhilippeC Avatar asked Nov 22 '13 10:11

PhilippeC


People also ask

How do you stop a command in Package Manager console?

If you want to close the Package Manager Console window, please use SHIFT + ESC to close current opened window in Visual Studio.


1 Answers

That appears to be buggy behavior. The >> indicates that syntactically the current command isn't finished. That is, you have opened a double quoted string but haven't finished it. Press the "Clear Console" toolbar button to escape out of this mode.

like image 139
Keith Hill Avatar answered Oct 02 '22 15:10

Keith Hill