Title: Missing MEL levels from LogLevel param in Start-EditorServices.ps1 · Issue #2235 · PowerShell/PowerShellEditorServices · GitHub
Open Graph Title: Missing MEL levels from LogLevel param in Start-EditorServices.ps1 · Issue #2235 · PowerShell/PowerShellEditorServices
X Title: Missing MEL levels from LogLevel param in Start-EditorServices.ps1 · Issue #2235 · PowerShell/PowerShellEditorServices
Description: Prerequisites I have written a descriptive issue title. I have searched all open and closed issues to ensure it has not already been reported. I have read the troubleshooting guide. I am sure this issue is with PowerShell Editor Services...
Open Graph Description: Prerequisites I have written a descriptive issue title. I have searched all open and closed issues to ensure it has not already been reported. I have read the troubleshooting guide. I am sure this ...
X Description: Prerequisites I have written a descriptive issue title. I have searched all open and closed issues to ensure it has not already been reported. I have read the troubleshooting guide. I am sure this ...
Opengraph URL: https://github.com/PowerShell/PowerShellEditorServices/issues/2235
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Missing MEL levels from LogLevel param in Start-EditorServices.ps1","articleBody":"### Prerequisites\n\n- [x] I have written a descriptive issue title.\n- [x] I have searched all [_open and closed_ issues](https://github.com/PowerShell/PowerShellEditorServices/issues?q=is%3Aissue) to ensure it has not already been reported.\n- [x] I have read the [troubleshooting](https://github.com/PowerShell/vscode-powershell/blob/main/docs/troubleshooting.md) guide.\n- [x] I am sure this issue is with _PowerShell Editor Services itself_ and does not reproduce in a standalone [PowerShell](https://github.com/PowerShell/PowerShell/issues/new/choose) instance, and is not an issue with my editor.\n- [x] I have verified that I am using the latest version of PowerShell Editor Services.\n- [ ] If this is a security issue, I have read the [security issue reporting guidance](https://github.com/PowerShell/vscode-powershell/blob/main/SECURITY.md).\n\n### Summary\n\nWhen you try starting PSES by calling `Start-EditorServices.ps1` with a [Microsoft.Extensions.Logging](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel) log level value, if it doesn't match one of the legacy log levels you get an error, e.g.:\n```sh\n19:22:57 ❯ pwsh -nol -nop -Command \"\u0026 '$PWD/PowerShellEditorServices/Start-EditorServices.ps1' -BundledModulesPath '$PWD' -LogPath '$PWD/powershell_es.log' -SessionDetailsPath '$HOME/.cache/nvim/powershell_es.session.json' -FeatureFlags @() -AdditionalModules @() -HostName nvim -HostProfileId 0 -HostVersion 1.0.0 -Stdio -LogLevel Information\"\nStart-EditorServices.ps1: Cannot validate argument on parameter 'LogLevel'. The argument \"Information\" does not belong to the set \"Diagnostic,Verbose,Normal,Warning,Error\" specified by the ValidateSet attribute. Supply an argument that is in the set\nand then try the command again.\n```\nAs you can see, it's expecting one of the legacy log levels: `Diagnostic`, `Verbose`, `Normal`, `Warning`, `Error`, while the MEL log level defines: `Trace`, `Debug`, `Information`, `Warning`, `Error`, `Critical`, `None`.\n\nSo these are the log levels missing from the validation (the one defined here [Start-EditorServices.ps1:49](https://github.com/PowerShell/PowerShellEditorServices/blob/3a429eac5544fd7613c281c0814f94ac03fad551/module/PowerShellEditorServices/Start-EditorServices.ps1#L49)):\n \n- `Trace`\n- `Debug`\n- `Information`\n- `Critical`\n- `None`\n\nI believe this was introduced while making the changes for #2200 and this spot was simply missed. Also, I think the legacy log levels should be kept while a clear cut hasn't been made, for compatibility reasons - as noted [here](https://github.com/PowerShell/PowerShellEditorServices/blob/3a429eac5544fd7613c281c0814f94ac03fad551/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs#L268):\n\u003e PSES used to have log levels that didn't match MEL levels, this is an adapter for those types and may eventually be removed once people migrate their settings.\n\nIf you'd like to reproduce the error, you just need to pass one of the log levels mentioned via `-LogLevel`, you can also use my command above, or you can use the one in the readme for [Advanced Usage](https://github.com/PowerShell/PowerShellEditorServices#advanced-usage), since it uses `Trace` for the log level.\n\n### Workaround\n`Warning` and `Error` can be used as is. For the rest of them, the code has the following mapping:\n\n| MEL (New) | Legacy |\n|-------------|------------|\n| Trace | Diagnostic |\n| Debug | Verbose |\n| Information | Normal |\n| Critical | _N/A_ |\n| None | _N/A_ |\n\n### PowerShell Version\n\n```console\nName Value\n---- -----\nPSVersion 7.5.1\nPSEdition Core\nGitCommitId 7.5.1\nOS Ubuntu 22.04.5 LTS\nPlatform Unix\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\nPSRemotingProtocolVersion 2.3\nSerializationVersion 1.1.0.1\nWSManStackVersion 3.0\n```\n\n### Editor Version\n\n```console\nNVIM v0.12.0-dev\nBuild type: RelWithDebInfo\nLuaJIT 2.1.1744317938\nCompilation: /usr/bin/cc -O2 -g -flto -fno-fat-lto-objects -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -fsigned-char -fstack-protector-strong -Wno-conversion -fno-common -Wno-unused-result -Wimplicit-fallthrough -fdiagnostics-color=always -DUNIT_TESTING -D_GNU_SOURCE -DINCLUDE_GENERATED_DECLARATIONS -DUTF8PROC_STATIC -I~/.local/share/mise/downloads/neovim/ref-nightly/.deps/usr/include/luajit-2.1 -I~/.local/share/mise/downloads/neovim/ref-nightly/.deps/usr/include -I~/.local/share/mise/downloads/neovim/ref-nightly/build/src/nvim/auto -I~/.local/share/mise/downloads/neovim/ref-nightly/build/include -I~/.local/share/mise/downloads/neovim/ref-nightly/build/cmake.config -I~/.local/share/mise/downloads/neovim/ref-nightly/src -I/usr/include \n\n system vimrc file: \"$VIM/sysinit.vim\"\n fall-back for $VIM: \"/share/nvim\"\n```\n\n### PowerShell Editor Services Version\n\n```console\n-\n```\n\n### Steps to Reproduce\n\n```sh\npwsh -nol -nop -Command \"./PowerShellEditorServices/Start-EditorServices.ps1 -SessionDetailsPath ./session.json -LogLevel Information\"\n```\n\n### Visuals\n\n_No response_\n\n### Logs\n\n_No response_","author":{"url":"https://github.com/eitamal","@type":"Person","name":"eitamal"},"datePublished":"2025-06-21T10:38:26.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/2235/PowerShellEditorServices/issues/2235"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:67c95097-3b0e-e1d7-19f0-803c1f38d9d6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CDAE:10DA0A:F52C8E:15F5869:6A589BEA |
| html-safe-nonce | f216f75755b1cf7551a2383cc0513f8dfb91445070e911e67e69385e80dfe2dd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDREFFOjEwREEwQTpGNTJDOEU6MTVGNTg2OTo2QTU4OUJFQSIsInZpc2l0b3JfaWQiOiI5MDkwMDQ5NDkyMzcwNDYyNTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6ec864ce5788682342fa57f32c8b74098bde0638e13292cbc867871130917d0e |
| hovercard-subject-tag | issue:3164987900 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShellEditorServices/2235/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9782624c0c4ead24bd0326f1d47eeeade7f0505bfb6fa4cb19db5ec33fb64c8c/PowerShell/PowerShellEditorServices/issues/2235 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9782624c0c4ead24bd0326f1d47eeeade7f0505bfb6fa4cb19db5ec33fb64c8c/PowerShell/PowerShellEditorServices/issues/2235 |
| og:image:alt | Prerequisites I have written a descriptive issue title. I have searched all open and closed issues to ensure it has not already been reported. I have read the troubleshooting guide. I am sure this ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | eitamal |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f2a0c7865178af3d91dd9f13b0cdfc3c73a2529c873d2780bb4c01271a57ec6 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShellEditorServices git https://github.com/PowerShell/PowerShellEditorServices.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 36031537 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShellEditorServices |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36031537 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShellEditorServices |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8aae7b8d6caacacf5c66eaeb2702d8dc88d85b4a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width