PowerShell / PowerShell/PSScriptAnalyzer
Weird rule violation when using a file path
Open
Nobody has claimed this yet.
Area - Rules
Issue - Bug
Need Repro Info
- Dominant language
- C#
- Stars
- 2.2k
- Forks
- 414
- Avg merge
- 13h 1m
- Merged PRs (30d)
- 2
Description
Before submitting a bug report:
- Make sure you are able to repro it on the latest released version
- Perform a quick search for existing issues to check if this bug has already been reported
Steps to reproduce
- git clone https://github.com/glennsarti/PSSummitNA2019-Pester102; cd PSSummitNA2019-Pester102
- checkout commit 33e6a712a9ee508fd4cac18c374f12a32291609e
- Open VSCode in the root of the git repo
- Browse to the file
MatterMostTests\OAT\Inspecster-report.ps1
VSCode Version: 1.31.1
PS Extension Version: 1.11.0
Expected behavior
No rule violations
Actual behavior
- VSCode reports a PSSA rule violation

Environment data
Within PowerShell console within VSCode
> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.17134.590
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17134.590
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
> (Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { $_.ToString() }
1.17.1
1.17.1
Windows 10 1803 - PS 5.1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the report by opening MatterMostTests\OAT\Inspecster-report.ps1 in VSCode with PSScriptAnalyzer 1.17.1, using the listed PowerShell and Windows environment details. Start by identifying which reported rule violation is tied to this file path, then verify the behavior against the expected result of no rule violations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell, vscode
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100