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
- Install PSScriptAnalyzer v1.25.0 (e.g., via
Install-Module)
- Open a PowerShell file in VS Code with the PowerShell extension v2025.4.0
- 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.
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
Install-Module)Error
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.