Skip to content

Add documentation for declaring module dependencies via #Requires#292

Draft
Copilot wants to merge 1 commit intomainfrom
copilot/create-docs-for-usage
Draft

Add documentation for declaring module dependencies via #Requires#292
Copilot wants to merge 1 commit intomainfrom
copilot/create-docs-for-usage

Conversation

Copy link
Contributor

Copilot AI commented Mar 12, 2026

Users adding RequiredModules to src/manifest.psd1 get silent data loss — the entries are not propagated to the built manifest. The correct approach (#Requires -Modules in individual function files) was undocumented.

Changes

  • README — folder tree annotations: Updated manifest.psd1 and functions/ entries to clarify that RequiredModules is not read from the source manifest, and that #Requires -Modules statements in function files are compiled into the built manifest
  • README — new "Declaring module dependencies" subsection: Added under "Module source code structure" explaining:
    • Use #Requires -Modules at the top of individual function files
    • Both bare-name and hashtable syntax variants (ModuleVersion, RequiredVersion)
    • How the build aggregates all declarations into RequiredModules in the final manifest
    • Design rationale: co-locating the dependency with the function that requires it

Example — correct way to declare a module dependency:

#Requires -Modules @{ ModuleName = 'Microsoft.Graph.Authentication'; ModuleVersion = '2.28.0' }

function Get-IntuneDeviceLogin {
    ...
}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/
    • Triggering command: /usr/bin/curl curl -s -o /dev/null -w %{http_code} --max-time 5 REDACTED (http block)
  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh gh label list --repo PSModule/Process-PSModule (http block)
    • Triggering command: /usr/bin/gh gh api graphql -f query={ repository(owner:"PSModule",name:"Process-PSModule") { labels(first:50) { nodes { name } } } } (http block)
    • Triggering command: /usr/bin/gh gh issue create --repo PSModule/Process-PSModule --title Add documentation for defining module dependencies using #Requires statements --body-file /tmp/issue-body.md --label NoRelease (http block)
  • https://api.github.com/repos/PSModule/Process-PSModule/issues
    • Triggering command: /usr/bin/curl curl -s -o /tmp/issue-response.json -w %{http_code} -X POST -H Authorization: token ****** -H Accept: application/vnd.github+json -H X-GitHub-Api-Version: 2022-11-28 REDACTED -d {"title": "Add documentation for defining module dependencies using #Requires statements", "body": "## Context\n\nWhen building a PowerShell module with Process-PSModule, developers often need to declare that their module depends on other modules (e.g., (http block)
    • Triggering command: /usr/bin/curl curl -s -X POST -H Authorization: token ****** -H Accept: application/vnd.github+json -H X-GitHub-Api-Version: 2022-11-28 REDACTED -d {"title": "Add documentation for defining module dependencies using #Requires statements", "body": "## Context\n\nWhen building a PowerShell module with Process-PSModule, developers often need to declare that their module depends on other modules (e.g., (http block)
    • Triggering command: /home/REDACTED/work/_temp/copilot-developer-action-main/github-mcp-server/github-mcp-server /home/REDACTED/work/_temp/copilot-developer-action-main/github-mcp-server/github-mcp-server stdio (http block)
  • https://api.github.com/repos/PSModule/Process-PSModule/issues/293/labels
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node -e const https = require('https'); const data = JSON.stringify({labels: ['NoRelease']}); const options = { hostname: 'api.github.com', port: 443, path: '/repos/PSModule/Process-PSModule/issues/293/labels', method: 'POST', headers: { 'Authoriza git nfig�� HEAD (http block)
  • https://api.github.com/repos/PSModule/Process-PSModule/labels
    • Triggering command: /usr/bin/gh gh api repos/PSModule/Process-PSModule/labels --jq .[].name (http block)
  • https://api.github.com/user
    • Triggering command: /usr/bin/curl curl -v -s -o /dev/null -w \nHTTP_CODE: %{http_code} -H Authorization: token ****** -H Accept: application/vnd.github+json REDACTED (http block)
    • Triggering command: /usr/bin/curl curl -s -w \nHTTP_CODE: %{http_code} -H Authorization: ****** -H Accept: application/vnd.github+json -H X-GitHub-Api-Version: 2022-11-28 REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add usage documentation for processes Add documentation for declaring module dependencies via #Requires Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants