Skip to content

Every time we analyze a '.ps1' file with custom rules, we need to import module once again. #1798

Open
@MoChilia

Description

@MoChilia

Hi! We are using PSSA to analyze syntax errors in '.ps1' files with custom rules. It seems that a new PowerShell session is created when we invoke-ScriptAnalyzer with custom rules, then all the modules imported before are lost. So, every time we analyze a '.ps1' file with custom rules, we need to import the needed module once again. However, it is time costly for us to import modules again and again. Since we work in the continuous integration environment, we need to import the modules built by CI but not the modules installed locally. 'Import-module' ahead of the '.psm1' file of custom rules seems indispensable. Can you give some suggestions to solve the problem of import modules too many times when analyzing dozens of '.ps1' files? Thanks a lot!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions