Skip to content

False positive on PSMissingModuleManifestField, not all PSD1 files are Module manifests #472

@Meglomax

Description

@Meglomax

Reference message: The member 'ModuleVersion' is not present in the module manifest. This member must exist and be assigned a version number of the form 'n.n.n.n'. Add the missing member to the file '...'.

It appears that the 'PSMissingModuleManifestField' rule is applied to all PSD1 files, which in many cases falsely identifies these files as Module manifests, which is not the case. Generically PSD1 files are just PowerShell Data files and can be put use in different ways. One example is when declaring and importing localized data related to script internationalization (see: https://technet.microsoft.com/en-us/library/hh847854.aspx).

I suggest modifying the test to determine that if a [FileName].psd1 file is identified, first look for a [FileName].psm1 file in the same folder, and if found test this rule.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions