-
Notifications
You must be signed in to change notification settings - Fork 510
Using Code Insiders 1.21.0 - Terminal crashes when formatting script with The term 'Invoke-Formatter' is not recognized as the name of a cmdlet #1193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
In this case, the crash is telling us the extension can't find the PSScriptAnalyzer module (or it finds one without the Invoke-Formatting command). Look in your log file for a few lines that should look like this:
What do you get when the extension tries to load this module? Where does it find the module and is there a valid module at that path? |
It finds the module in my local user path 10/02/2018 09:11:01 [NORMAL] - Method "FindPSScriptAnalyzerModule" at line 354 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Analysis\AnalysisService.cs
10/02/2018 09:11:01 [VERBOSE] - Method "EnumeratePSScriptAnalyzerCmdlets" at line 389 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Analysis\AnalysisService.cs
and doesnt have PSScriptAnalyzer in the vscode modules path
Mode LastWriteTime Length Name d----- 16/11/2017 19:25 Plaster Copying the PSScriptAnalyzer module folder from the .vscode\extensions\ms-vscode.powershell-1.5.1\modules fixed it Thank you for your help @rkeithhill |
I have a repro of the error:
code -v code --list-extensions --show-versions $psEditor.EditorServicesVersion Major Minor Build Revision 1 10 2 0 |
@craig-martin I believe this to be a different root cause. Can you open a new issue with the info above? @rjmholt I wonder if this line: Should be using |
Done. Thanks! |
@rkeithhill Agreed |
System Details
09/02/2018 10:51:31 [NORMAL] - Method "StartLogging" at line 144 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Host\EditorServicesHost.cs
Name Value
PSVersion 5.1.16299.98
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.16299.98
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
Insiders version 1.21 - updated to latest
Issue Description
Crashes when formatting PowerShell script whether saved or not whether 3 lines or 600 lines
Attached Logs
09/02/2018 10:51:53 [VERBOSE] - Method "ExecuteCommand" at line 551 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs
09/02/2018 10:52:02 [VERBOSE] - Method "ReadMessage" at line 123 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageReader.cs
09/02/2018 10:52:02 [VERBOSE] - Method "ResolveFilePath" at line 366 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Workspace\Workspace.cs
09/02/2018 10:52:02 [ERROR] - Method "OnListenTaskCompleted" at line 391 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\ProtocolEndpoint.cs
09/02/2018 10:52:02 [ERROR] - Method "ProtocolEndpoint_UnhandledException" at line 418 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Host\EditorServicesHost.cs
The text was updated successfully, but these errors were encountered: