Skip to content

Improve and package NetDiagram-PS for distribution - #7

Merged
jacobyoby merged 3 commits into
mainfrom
improve-and-package
Jul 30, 2026
Merged

jacobyoby merged 3 commits into
mainfrom
improve-and-package

Conversation

@jacobyoby

Copy link
Copy Markdown
Owner

Prepares NetDiagram-PS for possible PowerShell Gallery distribution: fixes real bugs, expands tests, adds CI, and aligns docs. All 36 Pester tests pass on PowerShell 7.6 (macOS); PSScriptAnalyzer reports no Error-severity findings.

Bug fixes

  • SNMP broken on macOS/Linux: Invoke-SnmpWalk hard-coded snmpwalk.exe, so SNMP discovery never worked on the platforms the 1.1.0 release advertised. Now resolves snmpwalk/snmpwalk.exe from PATH.
  • Subnet mask overflow: Test-IPInSubnet threw OverflowException on every non-zero prefix ([uint32]0xFFFFFFFF parses as int -1). Fixed with UInt64 math. This had silently broken CIDR matching in Get-SnmpNeighbors. Caught by a newly added test.
  • PowerShell floor wrong: Test-Connection -TimeoutSeconds is 7.4+, but the manifest advertised 7.0, so reachability calls errored on 7.0–7.3. Raised the minimum to 7.4 and added CompatiblePSEditions = @('Core').
  • Failing/incorrect tests: version assertion checked a stale 1.0.1; module path used a Windows-only literal backslash. Both fixed so the suite is green and cross-platform.

Packaging / distribution

  • Expanded Pester coverage (Get-MACVendor, Get-CommonSNMPStrings, Resolve-IPHostname, Invoke-SnmpWalk, Test-IPInSubnet).
  • GitHub Actions CI: Pester on Windows/macOS/Linux + PSScriptAnalyzer.
  • PUBLISHING.md with the Publish-Module path and a release checklist.
  • Docs/license aligned (MIT / Jacob Yoby), README install section, version bumped to 1.2.0.

Not done here (Jacob's calls)

  • Not merged to main; repo left private. No secrets or internal identifiers were found in the tree.

jacobyoby and others added 3 commits July 30, 2026 08:19
- Invoke-SnmpWalk hard-coded snmpwalk.exe, so SNMP discovery never worked
  on the macOS/Linux platforms added in 1.1.0. Resolve snmpwalk or
  snmpwalk.exe from PATH instead.
- Test-IPInSubnet threw an OverflowException on every non-zero prefix
  because [uint32]0xFFFFFFFF parses as int -1. Compute the mask in UInt64
  and truncate. This also silently broke CIDR matching in Get-SnmpNeighbors.
- Raise the module floor to PowerShell 7.4: Test-Connection -TimeoutSeconds
  (used by Test-DeviceReachability and the wizard) only exists in 7.4+, so
  the advertised 7.0 minimum errored at runtime.
- Add CompatiblePSEditions = @('Core') to the manifest and bump to 1.2.0.

Co-Authored-By: wren <wren@agent.local>
- Version assertion now reads the manifest instead of a stale hard-coded
  string (the 1.0.1 assertion failed against the 1.1.0 manifest).
- Build the module path with Join-Path (no literal backslash) so the suite
  runs on macOS/Linux as well as Windows.
- Add tests for Get-MACVendor, Get-CommonSNMPStrings, Resolve-IPHostname,
  Invoke-SnmpWalk (missing-binary path), and the private Test-IPInSubnet
  helper. These caught the subnet-mask overflow fixed in the prior commit.
- Add GitHub Actions workflow: Pester on Windows/macOS/Linux plus
  PSScriptAnalyzer (fails on Error severity).

Co-Authored-By: wren <wren@agent.local>
- LICENSE copyright holder and README license section now match the
  manifest (MIT, Jacob Yoby) instead of contradicting it.
- README documents installation (Gallery + clone) and the 7.4 requirement.
- STRUCTURE.md version corrected to match the manifest.
- CHANGELOG entry for 1.2.0.
- Add PUBLISHING.md describing the Publish-Module release path and a
  release checklist.

Co-Authored-By: wren <wren@agent.local>
@jacobyoby
jacobyoby marked this pull request as ready for review July 30, 2026 15:23
@jacobyoby
jacobyoby merged commit f372e3f into main Jul 30, 2026
8 checks passed
@jacobyoby
jacobyoby deleted the improve-and-package branch July 30, 2026 15:23
jacobyoby added a commit that referenced this pull request Jul 30, 2026
Covers SNMP node eligibility (#1), Invoke-SnmpWalk parameter validation (#6),
Invoke-PortScan validation (#7), Export-DrawIO duplicate-IP dedupe (#8) and
subnet-container parenting (#9), and the wizard CIDR math (#4).

Co-Authored-By: wren <wren@users.noreply.github.com>
jacobyoby added a commit that referenced this pull request Sep 9, 2026
- Strip bare #1/#4/#6/#7/#8/#9 references that collided with real GitHub
  issue numbers; keep real issue references (#10, #13, #15, #17, #19,
  #20, #27, #34). Manifest ReleaseNotes already free of #n.
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