Prerequisites
Summary
I've been using PSScriptAnalyzer (1.25.0) from the PowerShell command line on an individual file like:
Invoke-ScriptAnalyzer .\foo.ps1
I'm getting warnings for rules: PSAvoidShouldContinueWithoutForce, PSAvoidUsingInvokeExpression, PSReviewUnusedParameter, PSShouldProcess and PSUseSingularNouns
Now, 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
C:\Users\grolongo> $PSVersionTable
Name Value
---- -----
PSVersion 7.5.5
PSEdition Core
GitCommitId 7.5.5
OS Microsoft Windows 10.0.22631
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Editor Version
Emacs version: 30.2 (latest stable)
LSP client setup is really simple:
(use-package powershell :ensure t :demand t)
then to install the LSP server:
M-x powershell-install-langserver
Eglot connects successfully.
PowerShell Editor Services Version
Steps to Reproduce
- create a ps1 file and write a simple function with a plural noun like
Install-Programs
- run PSScriptAnalyzer:
Invoke-ScriptAnalyzer .\foo.ps1 -> PSUseSingularNouns warning reported
- open the same file in your editor with LSP on -> no warning reported
Visuals
No response
Logs
No response
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