It returns the Module info for the ScriptsToProcess then the Module.
That means $Parent = $Module.ModuleBase is actually an array of Strings, which ends up voiding $ModulePSD1Path and failing on Update-MetaData -Path $ModulePSD1Path -PropertyName FunctionsToExport -Value $FunctionsToExport.
Not too sure what's the best way to fix it yet, so thought I'd just raise an issue for now :)
Hi @gaelcolas , look at PR #47 . I had the exact same issue, and I would assume that this fixes things in a reasonable fashion (it does for me at least)
Interesting issue with ScriptsToProcess... The way the Module is invoked and loaded to extract some information does not work when there are ScriptsToProcess define in the PSD1 (yeah, need them because of scope issues). https://github.com/RamblingCookieMonster/BuildHelpers/blob/master/BuildHelpers/Public/Set-ModuleFunctions.ps1#L54
As you know, ScriptsToProcess are loaded in the session before importing the module, so when you execute this:
It returns the Module info for the ScriptsToProcess then the Module. That means
$Parent = $Module.ModuleBase
is actually an array of Strings, which ends up voiding$ModulePSD1Path
and failing onUpdate-MetaData -Path $ModulePSD1Path -PropertyName FunctionsToExport -Value $FunctionsToExport
.Not too sure what's the best way to fix it yet, so thought I'd just raise an issue for now :)