Add ScriptsToInclude
to the Module Manifest.
#24253
Labels
Issue-Enhancement
the issue is more of a feature request than a bug
Needs-Triage
The issue is new and needs to be triaged by a work group.
Summary of the new feature / enhancement
To extent on issue
#18740
Best practice: import functions in a module with a more practical propose:Adding a
ScriptsToInclude
to Module manifest elements would IMO allow for a safer (in terms of making module design misstakes) way to include scripts than dot-sourcing (invoking) multiple scripts from the<module>.psm1
file where only the embedded function (usually with the same name as the script file) is ment to be included.Proposed technical implementation details (optional)
My expectation of a
ScriptsToInclude
module manifest element, is that it loads one or more scripts (possibly supporting wildcards) into the module as a function using the script name as the function name similar as installing a script from the PowerShell Gallery (Install-Script -Name <MyScript>
).Maintaining (as debugging) the script apart (or not) from the module would also be easier as one might simply be able to test it by using it's file name
.\MyScript.ps1
(without dot-sourcing first) and even would be able compare the result with the already loaded module function (just namedMyScript
).The text was updated successfully, but these errors were encountered: