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

Error when Build-Module params are specified but no Build.psd1 present #44

Copy link
Copy link
@gaelcolas

Description

@gaelcolas
Issue body actions

When invoking the command Build-Module with required Parameters like this:
Build-Module -Path .\Source\ModuleBuilder.psd1 -OutputDirectory ..\ -VersionedOutputDirectory
but the Build.psd1 file is absent, we get the error below.
The only way to work around it is to create a Build.psd1 with an empty hashtable.

I think we should make that file optional when required parameters are provided, and clearer error when not.

> build-module -Path .\Source\ModuleBuilder.psd1 -OutputDirectory ..\ -VersionedOutputDirectory
Import-Metadata : Can't find file C:\src\ModuleBuilder\Source\[Bb]uild.psd1
At C:\src\ModuleBuilder\output\ModuleBuilder\1.0.0\ModuleBuilder.psm1:83 char:18
+ ... BuildInfo = Import-Metadata -Path (Join-Path $ModuleSource [Bb]uild.p ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (:) [Import-Metadata], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Metadata\Import-Metadata,Import-Metadata

InitializeBuild : You cannot call a method on a null-valued expression.
At C:\src\ModuleBuilder\output\ModuleBuilder\1.0.0\ModuleBuilder.psm1:610 char:27
+             $ModuleInfo = InitializeBuild $SourcePath
+                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [InitializeBuild], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull,InitializeBuild
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    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.