📖 [Docs]: Module dependency declaration using #Requires -Modules now documented#297
Open
📖 [Docs]: Module dependency declaration using #Requires -Modules now documented#297
Conversation
Copilot started work on behalf of
Marius Storhaug (MariusStorhaug)
March 13, 2026 15:33
View session
…ires statements Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add documentation for defining module dependencies using #Requires statements
docs: Add documentation for declaring module dependencies via #Requires -Modules
Mar 13, 2026
Marius Storhaug (MariusStorhaug)
requested changes
Mar 13, 2026
Member
Marius Storhaug (MariusStorhaug)
left a comment
There was a problem hiding this comment.
Copilot Please review comments.
Copilot started work on behalf of
Marius Storhaug (MariusStorhaug)
March 13, 2026 15:50
View session
…aintainability principle Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
Copilot started reviewing on behalf of
Marius Storhaug (MariusStorhaug)
March 13, 2026 23:38
View session
Contributor
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.