Set the powerShell.scriptAnalysis.settingsFilePath setting to a default for auto-discoverability
See original GitHub issueSummary of the new feature
Most linter tools automatically pick up the config file from the root of your workspace. We should do the same.
I’d like to set the default value for powerShell.scriptAnalysis.settingsFilePath to PSScriptAnalyzerSettings.psd1 which means that if there is a PSScriptAnalyzerSettings.psd1 in the root of the workspace, we will automatically use it.
If a user doesn’t want this, they can opt out via:
"powerShell.scriptAnalysis.settingsFilePath":""
but PSSA integration is one of our flagship features so we should streamline the experience.
Also, the user can still set it to something else if they so choose.
Proposed technical implementation details (optional)
Setting the default value for powerShell.scriptAnalysis.settingsFilePath to PSScriptAnalyzerSettings.psd1. Making sure our code is resilient if the file doesn’t exist.
I need to hear what @bergmeister has to say about this. Among anyone else 😃
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:9 (2 by maintainers)

Top Related StackOverflow Question
@bgelens your issue was fixed in https://github.com/PowerShell/PowerShellEditorServices/pull/1161 - a fix I made a few days after the last release… so it’s pending a release. Sorry about that.
[System.Uri]is a nightmare in a cross-plat world lolI have an issue with relative path with version
2020.1.0preview extension on mac with PSv7rc2I can only use the full path. Relative won’t work. I tried both
./PSScriptAnalyzerSettings.psd1andPSScriptAnalyzerSettings.psd1. The file is in the root of the folder I opened.From pses output:
Note file: in the middle
When specifying the full path, it works correctly.