PowerShell

Install Syntax Highlighting

Currently there is no maintained PowerShell parser available. If needed, configure a unmaintained parser by adding the following code to e.g. config.lua

local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
parser_config.powershell = {
  install_info = {
    url = "https://github.com/jrsconfitto/tree-sitter-powershell",
    files = {"src/parser.c"}
  },
  filetype = "ps1",
  used_by = { "psm1", "psd1", "pssc", "psxml", "cdxml" }
}
1
2
3
4
5
6
7
8
9

Install the configured parser.

:TSInstall powershell
1

Install Language Server

Download and unzip PowerShellEditorServicesopen in new window. PowerShell v7+open in new window is also required.

Set the location of unzipped PowerShell ES language server to e.g. config.lua

lvim.lang.ps1.bundle_path = "/path/to/unzipped/PowerShellEditorServices"
1

For more information about the language server configuration, refer to nvim-lspconfigopen in new window

Formatters

Formatting is supported by the PowerShell ES language server without additional configuration.