-
Notifications
You must be signed in to change notification settings - Fork 513
Extension crashes when formating #2027
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
Can you report the output of the following in the Integrated Console:
|
|
Hmmm that's odd; the shipped PSScriptAnalyzer seems to be there, and that directory is on the path, but it's not available for some reason. Maybe try:
And let us know what the output is |
PS C:\Users\ad_jcphilli> Import-Module C:\Users\ad_jcphilli.vscode\extensions\ms-vscode.powershell-2019.5.0\modules\PSScriptAnalyzer -PassThru
The contents of "C:\Users\ad_jcphilli.vscode\extensions\ms-vscode.powershell-2019.5.0\modules\PSScriptAnalyzer" is a single folder named "1.18.0", is that expected? |
Yes. This is expected. This is the structure of how PowerShellGet installs modules:
However... @rjmholt and I learned that support for this version number part didn't come until v5.0... and since you're on v4, it doesn't work. We will need to restructure our build logic here to move the contents of the
If you have any interest in contributing to the project, this change would be pure PowerShell and pretty straightforward. Otherwise we will get to it as soon as we can! |
Just so I've written in down for myself, this change only needs to go in the |
I'd like to pick this one up :) |
Awesome! Let me know if anything is not clear. I should note that this fix will require to you verify your fix on PowerShell v4 if you can... When you clone both
in each folder to work off of that code. Success here is: "I can format my scripts when using PowerShell v4 with the PowerShell extension." |
Thanks for the clear instructions! Verifying on PowerShell v3 and v4 is not a problem, I can spin up VM's for that. |
Issue Description
Whenever I try to format code, either from the context menu or via Ctrl-K Ctrl-F, the extension crashes, even on a file only containing "Import-Module ActiveDirectory". The log contains an entry "Exception: PSScriptAnalyzer cannot be imported, AnalysisService will be disabled", should I be installing that or is it expected to be installed by the extension?
Attached Logs
EditorServices.log
vscode-powershell.log
Environment Information
Visual Studio Code
PowerShell Information
Visual Studio Code Extensions
Visual Studio Code Extensions(Click to Expand)
The text was updated successfully, but these errors were encountered: