Skip to content

powershell_es wrong loglevel #3918

@bcarnazzi

Description

@bcarnazzi

Description

I've got this into my lsp.log With PowershellEditorServices 4.3.0:

[ERROR][2025-06-20 18:08:09] ...p/_transport.lua:36 "rpc" "pwsh" "stderr" "\27[31;1mStart-EditorServices.ps1: \27[31;1mCannot 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 and then try the command again.\27[0m\n"

init.lua workaround (manually setting LogLevel to Normal):

	local bundle_path = vim.fn.stdpath("data") .. "/PowerShellEditorServices"
	local temp_path = vim.fn.stdpath("cache")
	local command_fmt =
		[[& '%s/PowerShellEditorServices/Start-EditorServices.ps1' -BundledModulesPath '%s' -LogPath '%s/powershell_es.log' -SessionDetailsPath '%s/powershell_es.session.json' -FeatureFlags @() -AdditionalModules @() -HostName nvim -HostProfileId 0 -HostVersion 1.0.0 -Stdio -LogLevel Normal]]
	local command = command_fmt:format(bundle_path, bundle_path, temp_path, temp_path)
	vim.lsp.config("powershell_es", {
		bundle_path = bundle_path,
		cmd = { "pwsh", "-NoLogo", "-NoProfile", "-Command", command },
	})

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions