Skip to content

fix: finish all 3 remaining in-construction functions - #117

Merged
mikemadeja merged 1 commit into
developfrom
fix/complete-in-construction-functions
Sep 26, 2026
Merged

mikemadeja merged 1 commit into
developfrom
fix/complete-in-construction-functions

Conversation

@mikemadeja

Copy link
Copy Markdown
Owner

Summary

Fixes the last 3 functions still flagged as "in construction" (🚧 or unexported):

Get-PiHoleList was fully functional already (heavily exercised all session as a dependency of Add/Remove/Update-PiHoleList) - just had the WIP flag lingering and an incomplete docstring (missing -List param docs, .DESCRIPTION, .EXAMPLE).

Get-PiHoleLogWebserver wasn't exported at all, had the stray break bug, and its formatted-output branch was a literal empty stub (#$ObjectFinal = @(), did nothing). Also fixed a real bug found while rewriting it: the nextID query parameter was sent as nextId (wrong case) - confirmed against the live API spec, which names it nextID. Rewrote the formatted output as {Log, NextID, Pid, File}, preserving NextID so incremental polling (the endpoint's whole reason for existing) actually works from PowerShell. Now exported.

Get-PiHoleTeleporterDownload wasn't exported, had the stray break bug, a copy-pasted wrong .SYNOPSIS ("Get info about logs for webserver"), and assumed the downloaded backup was a .tar.gz - the live API spec documents the response as application/zip, confirmed by actually downloading a file and checking its magic bytes (50 4B 03 04, a real ZIP) and opening it with System.IO.Compression.ZipFile. Removed the -RawOutput parameter, since the API always returns a binary archive rather than JSON - there's no alternate raw representation for it to toggle to. Now exported.

With this merged, there are no more "in construction" functions in the module.

Test plan

  • Invoke-ScriptAnalyzer -Path .\PiHoleShell -Recurse - clean
  • Verified all three against a real Pi-hole v6 server, including opening the actually-downloaded ZIP file to confirm it's valid
  • New integration test files for the latter two (Get-PiHoleList already had one) - 8 new tests, all passing
  • Full non-integration suite passes with no regressions (157 tests)
  • Regenerated README.md

🤖 Generated with Claude Code

Get-PiHoleList: was fully functional already (heavily exercised all
session as a dependency of Add/Remove/Update-PiHoleList), just had the WIP
flag lingering and an incomplete docstring (missing -List param docs,
.DESCRIPTION, .EXAMPLE).

Get-PiHoleLogWebserver: wasn't exported at all, had the stray break bug,
and its formatted-output branch was a literal empty stub
(`#$ObjectFinal = @()`, did nothing). Also fixed a real bug found while
rewriting it: the nextID query parameter was sent as `nextId` (wrong
case) - confirmed against the live API spec, which names it `nextID`.
Rewrote the formatted output as {Log, NextID, Pid, File}, preserving the
NextID field so incremental polling (the endpoint's whole reason for
existing) actually works from PowerShell. Exported it.

Get-PiHoleTeleporterDownload: wasn't exported, had the stray break bug, a
copy-pasted wrong .SYNOPSIS ("Get info about logs for webserver"), and
assumed the downloaded backup was a .tar.gz - the live API spec documents
the response as application/zip, confirmed by actually downloading a file
and checking its magic bytes (50 4B 03 04, a real ZIP) and opening it with
System.IO.Compression.ZipFile. Removed the RawOutput parameter, since the
API always returns a binary archive rather than JSON - there's no
alternate raw representation for it to toggle to. Exported it.

Verified all three against a real Pi-hole v6 server. Added dedicated
integration test files for the latter two (Get-PiHoleList already had
one). README regenerated to drop the WIP flag and list the two newly
exported functions.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@mikemadeja
mikemadeja merged commit 49cd0d4 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