Repository navigation
ScriptAnalyzer is missing a lot of warnings #2280
Description
Activity
- addedIssue-BugA bug to squash.A bug to squash.Needs: TriageMaintainer attention needed!Maintainer attention needed!
on Apr 17, 2026 andyleejordan commented
on Apr 21, 2026 MemberMore actionsMy question is, is it possible to modify the default settings or rules included? Or is it a bug somewhere?
Yes it is possible and to my recollection, the default config in PSES is not the same as the default config running PSSA by itself. Why it was designed that way, I don't know. How to configure it over LSP in Emacs...I'd have to dig but I think you can find it in another issue.
andyleejordan commented
on Apr 21, 2026 MemberMore actionsI dug and couldn't find it. It's a matter of setting the server's PSSA config options via Eglot.
Thank you Andy,
I tried to change the rules tweaking the configuration files in
c:/Users/grolongo/AppData/Roaming/.emacs.d/.cache/powershell/PSScriptAnalyzer/1.25.0/
but that didn't work.If I can manage to do that from Eglot that would be even better. I'll reply back if I can find the solution.
Alright, managed to find it with Eglot. So for reference, if someone wants to change what rules to apply or not for any project, do it like this (Emacs only):
Create a ps data file, call it
PSScriptAnalyzerSettings.psd1for example, and inside it add your rules:@{ Rules = @{ PSUseSingularNouns = @{ Enable = $true } PSShouldProcess = @{ Enable = $false } PSAvoidShouldContinueWithoutForce = @{ Enable = $true } } }
Then in your
init.el:(setq-default eglot-workspace-configuration '(:powershell (:scriptAnalysis (:settingsPath "path/to/PSScriptAnalyzerSettings.psd1"))))
and voilà!
andyleejordan commented
on Apr 23, 2026 MemberMore actionsThat's it! Good work.
- pinned this issue
on Apr 23, 2026
Prerequisites
Summary
I've been using PSScriptAnalyzer (1.25.0) from the PowerShell command line on an individual file like:
Invoke-ScriptAnalyzer .\foo.ps1I'm getting warnings for rules:
PSAvoidShouldContinueWithoutForce,PSAvoidUsingInvokeExpression,PSReviewUnusedParameter,PSShouldProcessandPSUseSingularNounsNow, I've been running PowerShellEditorServices LSP (latest version) in my editor on that same file but I'm not getting any of these warnings reported. And yes the LSP is working because it reported other types of errors/warnings normally.
My question is, is it possible to modify the default settings or rules included? Or is it a bug somewhere?
PowerShell Version
Editor Version
PowerShell Editor Services Version
ModuleVersion = '4.5.0'Steps to Reproduce
Install-ProgramsInvoke-ScriptAnalyzer .\foo.ps1->PSUseSingularNounswarning reportedVisuals
No response
Logs
No response