Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom settings for the PSScriptAnalyzer invocation #25

Open
acraileanu opened this issue Oct 22, 2019 · 0 comments
Open

Allow custom settings for the PSScriptAnalyzer invocation #25

acraileanu opened this issue Oct 22, 2019 · 0 comments

Comments

@acraileanu
Copy link

Hi team,

The integration between this module and the PSScriptAnalyzer one is a great way of using one tool for multiple purposes and generating one common report for a solution. While one does not expect to have full flexibility offered by all the external modules, I think some of the basic functionality and flexibility of the external ones could be added to make the usage more robust and avoid workarounds/hacks in using this module.

Expected Behavior

It would be great if we would be able to specify the settings used for the PSScriptAnalyzer invocation, as the support for it specifies.

While I am aware that one could resolve this by adding a file named PSScriptAnalyzerSettings.psd1 in the root of the project, I believe that this limits the flexibility provided by that module (not being able to use built-in presets or to have the settings file in a different location, etc.).

Current Behavior

You are currently not able to enable or disable different rules, which limits the accuracy and reliability of the generated report.

Possible Solution

I believe we could either add an extra run parameter or a configuration in the settings file that allows you to specify the settings used by the PSScriptAnalyzer rules settings which would then be passed in that module's invocation. If this is not provided, it should use the current call, using the implicit settings.

Context

We have a project where we have set some custom rules for the PSScriptAnalyzer, and those settings are not in the root folder (rather a .settings/psScriptAnalyzer/psd1 file, a folder where we store different configurations for different environments and tools, including PSCodeHealth). When running the PSCodeHealth checker, this uses the default set of rules, thus flagging some errors and warnings which are disabled by our original settings.

Your Environment

  • Module version used: 0.2.26
  • Operating System and PowerShell version: Windows 10 / PowerShell 5.1.17763.771

Cheers and thanks for creating this tool!
Andrei

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant