Repository navigation
Research pass: literal path handling for inventory and exports - #85
Merged
Merged
Conversation
…xport Use -LiteralPath for Test-Path, Get-Content, and Out-File where user-supplied paths may contain wildcard metacharacters. Add Pester coverage for bracket paths and XML-special characters in diagram output. Co-authored-by: Jacobrakai <jacobyoby@users.noreply.github.com>
This was referenced Sep 17, 2026
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.
Research summary
Reviewed
README.md,AGENTS.md, CI (three-OS Pester + smoke + PSScriptAnalyzer), and theNetDiagram-PSPublic/Private split. The module already follows solid patterns: XML escaping viaSecurityElementinExport-DrawIO, SNMP argument-injection guards inInvoke-SnmpWalk, and-LiteralPathon several import/export cmdlets (Import-Topology,Import-NmapScan, most exporters' existence checks).Gap found: a few user-path entry points still used
-PathforTest-Path/Get-Content/Out-File. On Windows (and anywhere PowerShell treats[]as wildcards), inventory or credential-map files under paths likeinventory[site1].jsoncould fail to open or match the wrong file.Changes
Import-Inventory—-LiteralPathfor existence check and JSON read.Get-SnmpNeighbors/Get-SnmpBridgeNeighbors— same for credential-map paths.Compare-NetworkScans— literal metadata reads and reportOut-File.Export-DrawIO— literalOut-File(aligned with existingTest-Path -LiteralPathon-OutFile)..drawiooutput path.CHANGELOG.md— Unreleased fix note.Tests
POSIX runner:
./tests/run-tests.sh→ exit 2 (CANNOT-RUN) —pwshnot available in the cloud agent environment. CI on the PR should run the full matrix.Scope
Small, behavior-compatible hardening/DX fix; no manifest version bump.