gaelcolas / Sampler

Module template with build pipeline and examples, including DSC elements.
MIT License
171 stars 42 forks source link

Where is PSScriptAnalyzerSettings.psd1 supposed to be stored? #489

Open DennisL68 opened 3 months ago

DennisL68 commented 3 months ago

In the default module.tests.ps1, the ScriptAnalyzer rules are fetched using $scriptAnalyzerRules = Get-ScriptAnalyzerRule.

But where should I store the PSScriptAnalyzerSettings.psd1 file, if I'd like to use different settings for different modules?

johlju commented 3 months ago

In the default module.tests.ps1, the ScriptAnalyzer rules are fetched using $scriptAnalyzerRules = Get-ScriptAnalyzerRule.

That is only used to determine if the tests should be run or skipped.

But where should I store the PSScriptAnalyzerSettings.psd1 file, if I'd like to use different settings for different modules?

Current module.tests.ps1 does not support that as that is something that need to be passed to Invoke-ScriptAnalyzer. The QA tests could be improved to use a script analyzer settings file. Preferably is should use the same one that is located in the .vscode folder that is also used by the PowerShell extension in VS Code.