Uh oh!
There was an error while loading. Please reload this page.
📖 [Docs]: Module dependency declaration using #Requires -Modules now documented - #297
Conversation
…ires statements Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
Marius Storhaug (MariusStorhaug)
left a comment
There was a problem hiding this comment.
Copilot Please review comments.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…aintainability principle Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR adds missing documentation to the README explaining how to declare module dependencies using #Requires -Modules statements in function files, addressing a gap where developers were unknowingly adding RequiredModules to src/manifest.psd1 only to have those entries silently dropped during the build.
Changes:
- Added a new "Declaring module dependencies" subsection under "Module source code structure" explaining the
#Requires -Modulesmechanism and the build aggregation behavior - Added a co-location maintainability principle to the "Principles and practices" section
You can also share your feedback on Copilot code review. Take the survey.
…criptions for better maintainability
…cy in documentation
…cy in documentation
Uh oh!
There was an error while loading. Please reload this page.
The README now documents how to declare module dependencies using
#Requires -Modulesstatements in individual function files. Developers who previously addedRequiredModulestosrc/manifest.psd1— only to have those entries silently dropped during the build — can now find clear guidance on the correct approach.New: Module dependency documentation
A new "Declaring module dependencies" subsection under "Module source code structure" explains:
#Requires -Modulesat the top of individual function files (insrc/functions/public/andsrc/functions/private/)#Requires -Modulesstatements across source files into theRequiredModulesfield of the built manifestAn
[!IMPORTANT]callout explicitly warns that addingRequiredModulestosrc/manifest.psd1is silently ignored by the build — dependencies must use#Requires -Modulesinstead.New: Co-location principle
A new entry in the "Principles and practices" section explains why dependency declarations belong in each function file rather than a central manifest, and how this prevents silent drift between the manifest and the actual code.