Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Build-Module can produce invalid module without raising error #101

Copy link
Copy link
@daviesj

Description

@daviesj
Issue body actions

In at least two cases, Build-Module produces a module which cannot be imported and does not generate an error:

  • When you have a valid Build.psd1 and manifest but no source .ps1 files, Build-Module creates the output folder and the output manifest, but no .psm1.
  • When you have certain syntax errors (such as mismatched braces or misspelled function), Build-Module produces a .psm1 that will fail to import and does not complain about it.

It would be helpful if the tool responsible for building a script module could avoid producing output which cannot be imported and report an error when it is unable to do so.

If I were designing a build tool like this:

  • In the case of no source files, it would produce an error message and no output would be created. Another option would be to generate an empty .psm1 file if there is some reason for wanting to be able to generate a manifest even when there are no source files. An empty .psm1 can still be imported.
  • When there are syntax errors that would prevent the output module from being imported, it would report the errors, including source file and location, and generate no output.
Reactions are currently unavailable

Metadata

Metadata

Assignees

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

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.