-
Notifications
You must be signed in to change notification settings - Fork 234
Warning is not a valid log level in Start-EditorServices.ps1 #894
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
@allthejunkfood feel free to contribute the addition of the |
Should this issue be moved to the PowerShellEditorServices repo then? |
I probably should be. @TylerLeonhardt or @rjmholt should have the ability to move the issue. But more important is to get a PR in to add support for Warning. |
transfered :) |
Pull request #895 raised. |
Looks like the PR didn't specify that it fixes this issue... Should this be closed now? |
System Details
System Details Output
Issue Description
Powershell Integrated Console Start-EditorServices terminated with Exit code: 1
Then the language Service could not be started
Expected Behaviour
...I mean... It should just run...
What I did to fix it
Just as an FYI: I imagine that this will only help those that it affects directly (or fall under these circumstances)
Happened to notice that when VS code would boot up, there would be some red text at the powershell screen. It would quickly go away and then start the "Exit Code: 1" nonsense. (Hooray for useful exit codes! Hooray for School!)
What was the error? Well you have to hit printscreen to capture it at VScode startup but here was mine:
C:\users<REDACTED>.vscode\extensions\ms-vscode.powershell-1.11.0\modules\PowerShellEditorServices\Start-EditorServices.ps1: Cannot validate argument on parameter 'LogLevel'. The argument "warning" does not belong to the set "Diagnostic,Normal,Verbose,Error" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.
There was some more error jazz, but for the most part, useless info.
To fix that -
Add
"Warning"
[ValidateSet("Normal", "Verbose", "Error", "Diagnostic","Warning")]
$LogLevel = "Normal",
to the two following files:
C:\Users<MonkeyTown>.vscode\extensions\ms-vscode.powershell-1.11.0\modules\PowerShellEditorServices\Start-EditorServices.ps1
and
C:\Users<MonkeyTown>.vscode\extensions\ms-vscode.powershell-1.11.0\modules\PowerShellEditorServices\PowerShellEditorServices.psm1
Whamo blamo... new error.
rinse repeat (exit vscode, and reopen printscreen)
Error: Start-EditorServices.ps1 cannot be loaded the contents of C:\Users<MonkeyTown>.vscode\extensions\ms-vscode.powershell-1.11.0\modules\PowerShellEditorServices\Start-EditorServices.ps1 might have been changed....
CHANGED
For mo' better security, I have AllSigned scripts turned on. What does that mean now? Hammer Time.
Go through and with a code signing certificate sign every (I mean every) ps1 psm1 psd1 with my local trusted certificate. Cause why? Cause I now own all those files and they are trusted by me.
For this portion, if you don't have a code signing certificate, either public or privately issued. Get one. Private? use PKI.
Added Bonus, here is a code signing script I Frankensteined:
Function Sign-Script {
<#
I hope this helps someone at some point.
Attached Logs
Follow the instructions in the troubleshooting docs
about capturing and sending logs.
The text was updated successfully, but these errors were encountered: