Skip to content

Bundled PowerShell Editor Services 4.4.0 conflicts with PSScriptAnalyzer 1.25.0 #5493

@tillig

Description

@tillig

Summary

The current release (v2025.4.0) bundles PowerShell Editor Services v4.4.0, which includes PSScriptAnalyzer v1.24.0. When PSScriptAnalyzer v1.25.0 is also installed on the system, the extension fails to load the analysis module due to type data conflicts.

Steps to Reproduce

  1. Install PSScriptAnalyzer v1.25.0 (e.g., via Install-Module)
  2. Open a PowerShell file in VS Code with the PowerShell extension v2025.4.0
  3. Observe analysis errors in the PowerShell Editor Services log

Error

[Error] Microsoft.PowerShell.EditorServices.Services.Analysis.PssaCmdletAnalysisEngine:
The 'Invoke-ScriptAnalyzer' command was found in the module 'PSScriptAnalyzer', but the
module could not be loaded due to the following error: [The following error occurred while
loading the extended type data file:
Error in TypeData "Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.RuleInfo": The member DefaultDisplayPropertySet is already present.
Error in TypeData "Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.SuppressedRecord": The member DefaultDisplayPropertySet is already present.
Error in TypeData "Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.SuppressedRecord": The member Justification is already present.
Error in TypeData "Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.SuppressedRecord": The member Column is already present.
Error in TypeData "Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.SuppressedRecord": The member Line is already present.
Error in TypeData "Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord": The member DefaultDisplayPropertySet is already present.
Error in TypeData "Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord": The member Column is already present.
Error in TypeData "Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord": The member Line is already present.
]

Expected Behavior

The extension should work with PSScriptAnalyzer v1.25.0 installed on the system without type data conflicts.

Proposed Fix

Update the bundled PowerShell Editor Services from v4.4.0 to v4.5.0, which includes support for PSScriptAnalyzer v1.25.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions