PowerShell / PowerShell/PSScriptAnalyzer

Settings file needs to have a exclude / ignore mechanism

Open
#1,230 5 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area - Configuration Issue - Enhancement
Dominant language
C#
Stars
2.2k
Forks
414
Avg merge
13h 1m
Merged PRs (30d)
2

Description

**There needs to be an "exclude" option e.g. "exclude .tests.ps1" **

I have a module with ~ 200 pester tests attached. In VSCode if I attach a settings file the analyzer reports each pester command in each file is not found, by default, in each of the profiles where pester is not present. This reports so many false positives it is impossible to see the things which should be fixed. (VS code just says "> 1000 problems" and stops counting!)

Proposed technical implementation details (optional)

An option in the settings file (and perhaps on the command line) which said "exclude files which match this regular expression" would allow a subfolder, or certain names to be ignored. This is preferable to scanning those files, and trying to figure out which messages to hide, or having a mechanism for saying "Tell me if I'm using a module which isn't in V6 ... except don't tell me about Pester ... unless I've used it outside this folder" .

What is the latest version of PSScriptAnalyzer at the point of writing
1.18.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how PSScriptAnalyzer reads settings files and handles command-line options. Determine where file selection occurs and how an exclude pattern would fit both entry points. Done means users can exclude matching files so their diagnostics are not reported, including the Pester-related false positives described here.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
cli, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.