Home Dashboard Directory Help
Search

NestedModules breaks when specifying a full ModuleSpecification which matches more than one module by Joel 'Jaykul' Bennett


Status: 

Active


1
0
Sign in
to vote
Type: Bug
ID: 783131
Opened: 4/6/2013 1:43:38 PM
Access Restriction: Public
2
Workaround(s)
view
0
User(s) can reproduce this bug

Description

If a Module psd1 file specifies NestedModules by hashtable with ModuleName and ModuleVersion, it will fail to load if there is more than one module with that name available on the system (even if the ModuleVersion only matches one of the modules).

Note that if a Module psd1 file specifies NestedModules by name only, you can have exact the same module available in two places in your PSModulePath without problems.
Details
Sign in to post a comment.
Posted by Joel 'Jaykul' Bennett on 4/6/2013 at 9:39 PM
RequiredModules doesn't have this problem with version numbers, so it's probably much safer to use that.
Posted by Joel 'Jaykul' Bennett on 4/6/2013 at 2:10 PM
Note that if you specify the nested module by name only it will work, but WHICH module is loaded is purely based on the path order precedence in your PSModulePath.
Sign in to post a workaround.
Posted by Joel 'Jaykul' Bennett on 4/6/2013 at 9:40 PM
Use RequiredModules instead if you're using a full ModuleSpecification
Posted by Joel 'Jaykul' Bennett on 4/6/2013 at 1:54 PM
Change the NestedModule to just the module name, instead of a full modulespecification.