Vscode-powershell: Duplicate PSSA-entries in Problem-tab after reopening file

Created on 21 Mar 2021  路  1Comment  路  Source: PowerShell/vscode-powershell

Issue Description

Every time I open the same powershell-files, the same issues caught by the PSSA-integration are duplicated over and over in the Problems-tab in VSCode.

Steps to reproduce:

  1. Open VSCode with vscode-powershell enabled in a new folder with the following files:

demo.ps1

$myVar = "foo"

PSScriptAnalyzerSettings.psd1

@{
    Severity = @('Error','Warning')
    IncludeDefaultRules = $true
}
  1. Click on demo.ps1 and wait for the "variable never used"-problem
    image
  2. Close the file-tab (or click on PSScriptAnalyzerSettings.ps1 so it replaces the demo.ps1 file tab) and then open demo.ps1 again. The problem will now be shown twice or as many times as you reopen it
    image

Attached Logs

Follow the instructions in the README about
capturing and sending logs.

Environment Information

Visual Studio Code

| Name | Version |
| --- | --- |
| Operating System | Windows_NT x64 10.0.19042 |
| VSCode | 1.54.3|
| PowerShell Extension Version | 2021.2.2 |

PowerShell Information

|Name|Value|
|---|---|
|PSVersion|7.1.3|
|PSEdition|Core|
|GitCommitId|7.1.3|
|OS|Microsoft Windows 10.0.19042|
|Platform|Win32NT|
|PSCompatibleVersions|1.0 2.0 3.0 4.0 5.0 5.1.10032.0 6.0.0 6.1.0 6.2.0 7.0.0 7.1.3|
|PSRemotingProtocolVersion|2.3|
|SerializationVersion|1.1.0.1|
|WSManStackVersion|3.0|

Visual Studio Code Extensions

Visual Studio Code Extensions(Click to Expand)

|Extension|Author|Version|
|---|---|---|
|powershell|ms-vscode|2021.2.2|

Area-Script Analysis Issue-Bug Up-for-Grabs

Most helpful comment

Thanks @fflaten I can reproduce this

>All comments

Thanks @fflaten I can reproduce this

Was this page helpful?
0 / 5 - 0 ratings