Skip to content

Do not PSAvoidUsingDeprecatedManifestField if PowerShellVersion = '2.0' #428

@nightroman

Description

@nightroman

This manifest (some fields omitted)

@{
    ...
    ModuleToProcess = 'SplitPipeline.dll'
    PowerShellVersion = '2.0'
}

causes

RuleName                            Severity     FileName   Line  Message
--------                            --------     --------   ----  -------
PSAvoidUsingDeprecatedManifestField Warning      SplitPipel 1     The module manifest member 'ModuleToProcess' has been
s                                                ine.psd1         deprecated. Use the 'RootModule' member instead.

It should not if the target PowerShell version is 2.0, like in the above example.

The field RootModule was introduced in v3 and v2 fails to load such a
manifest. Thus, for v2 ModuleToProcess is the only option and it should not
cause a warning.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions