Skip to content

docs: add auto-generated real example output for every function - #118

Merged
mikemadeja merged 1 commit into
developfrom
docs/example-output
Sep 26, 2026
Merged

mikemadeja merged 1 commit into
developfrom
docs/example-output

Conversation

@mikemadeja

Copy link
Copy Markdown
Owner

Summary

  • Adds tools/Update-ExampleOutput.ps1, which runs every exported function against a real Pi-hole server and writes docs/EXAMPLES.md — one section per function with the exact invocation shown and the real captured output below it, grouped the same way as README.md's Command Reference.
  • State-changing functions (groups, lists, sessions) exercise a create → verify → cleanup lifecycle against a clearly-named throwaway resource (PiHoleShellDocsExampleGroup, a real list URL), removed immediately after capture — same pattern already used by this module's integration tests.
  • Functions with real side effects on a live server (gravity rebuild, DNS restart, network/query-log flush, DNS blocking toggle) are skipped by default in favor of a previously-captured static example; pass -IncludeDisruptive to live-capture those too.
  • Links docs/EXAMPLES.md from README.md's table of contents and Command Reference section.

Test plan

  • Ran ./tools/Update-ExampleOutput.ps1 against a real Pi-hole v6 server end-to-end; verified every invocation shown matches the resource actually used to produce the output below it (fixed several places where the two had drifted).
  • Confirmed the server and local temp files were left clean after the run (no leftover test group, list, or teleporter scratch folder).
  • Invoke-ScriptAnalyzer clean against the new script.
  • Full non-integration Pester unit suite passes (4/4; this repo's other suites are integration tests against a real server, untouched by this change).

🤖 Generated with Claude Code

Adds tools/Update-ExampleOutput.ps1, which runs every exported function
against a real Pi-hole server and writes docs/EXAMPLES.md - one section
per function with the exact invocation and the real captured output,
grouped the same way as README.md's Command Reference. State-changing
functions (groups, lists, sessions) use a throwaway resource that's
cleaned up immediately after capture. Functions with real side effects
on a live server (gravity rebuild, DNS restart, network/log flush, DNS
blocking toggle) are skipped by default in favor of a previously
captured static example, unless -IncludeDisruptive is passed.

Links docs/EXAMPLES.md from README.md's table of contents and Command
Reference section.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@mikemadeja
mikemadeja merged commit 73ff464 into develop Sep 26, 2026
3 checks passed
@mikemadeja mikemadeja mentioned this pull request Sep 26, 2026
1 task done
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.

1 participant