PowerShell diagnostics for Claude Code

What those attestation badges do NOT cover. The SBOM, provenance, and Sigstore badges
attest build integrity over the source archive -- they are not Windows Authenticode,
assert no verified-publisher identity, and are not a third-party security audit. The
exact boundary is stated in What this does and does not prove
below and in TRUST.md, "Honest limits".
An AI coding agent can produce PowerShell that looks right, is objectively wrong, and gets
built upon before anyone notices it. Nothing catches that until the script runs -- often much
later, on someone else's machine.
This plugin runs Microsoft's own PowerShell analysis after every edit Claude makes and sends
the findings straight back into Claude's context -- real PowerShell Editor Services (PSES) +
PSScriptAnalyzer, not a re-implementation, so a mistake gets caught and corrected in the same
turn instead of shipping.
Why not another PowerShell LSP plugin? It proves the analysis actually ran instead of reading
silence as success, it manages the PowerShell toolchain itself, and it works the same way in CI
and air-gapped as it does live in an edit.
It is language tooling, not project tooling: no recurring prompt injection, context is added only
when a PowerShell edit produces diagnostics or enabled guidance, and one warm language-server
process per session means each edit pays a fast pipe round-trip instead of a cold start.

Install and verify in about five minutes -- install to a real caught diagnostic, including the
first-session bootstrap you cannot skip. Requires pwsh (PowerShell 7+) on your PATH
(winget install Microsoft.PowerShell if it is missing); then:
# 1. In Claude Code -- add the marketplace, install, then enable the plugin:
/plugin marketplace add manderse21/claude-powershell-lsp
/plugin install powershell-lsp@claude-powershell-lsp
/plugin enable powershell-lsp
# 2. Start a new session (or /reload-plugins) so the hooks load and the first
# SessionStart bootstraps PSES + the warm daemon.
# 3. Confirm it is healthy BEFORE you rely on it -- run the preflight DOCTOR from
# inside the enabled session (so it can see the plugin data dir):
/powershell-lsp:doctor
# All PASS (benign UNKNOWNs are fine) -> ready. A FAIL names the exact fix.
See it catch something. Ask Claude to write:
function Frobnicate-Thing { Get-Process }
and the PostToolUse hook returns, right in Claude's context:
The cmdlet 'Frobnicate-Thing' uses an unapproved verb. (PSUseApprovedVerbs)
Claude sees its own mistake and corrects it without you switching tools. Full prerequisites and
the step-by-step walkthrough are in Quick start.
Why not a generic PowerShell LSP setup?
A hand-wired PSES + PSScriptAnalyzer language-server config can give you diagnostics too. Three
things it will not give you are what this plugin is actually for:
| A generic LSP setup | This plugin |
|---|
| When the toolchain silently fails to start | Reads as "no findings" -- indistinguishable from clean code | /powershell-lsp:doctor proves what actually ran, with a named fix for anything that did not (see Diagnostics status) |
| Installing PSES + PSScriptAnalyzer | Your job -- match versions, keep them current | Downloaded, version-pinned, and SHA-256-verified on first use; nothing to install by hand (see What it downloads) |
| CI and air-gapped hosts | Usually editor-only | The same engine runs headless via scripts/lsp-scan.ps1 (SARIF for code scanning) and offline from a verified, attested bundle (see Repository and CI validation, Offline install) |