diff --git a/CHANGELOG.md b/CHANGELOG.md index 1086e9e..7cb7057 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.4.1] - 2026-09-17 + ### Fixed - **Literal path handling for JSON inputs and diagram output.** `Import-Inventory`, SNMP credential-map readers, `Compare-NetworkScans` metadata inputs, and @@ -16,6 +18,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 `Export-Topology`, `Export-Mermaid`, `Export-NodeInventoryCsv`, and `Export-NetBox` now write with `Out-File -LiteralPath` (CSV row export already used `-LiteralPath`). +- **Wizard output paths.** `examples/New-NetworkDiagram.ps1` uses + `-LiteralPath` when writing the diagram inventory and checking the draw.io + output file. ## [1.4.0] - 2026-09-09 @@ -262,6 +267,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [1.0.0]: https://github.com/jacobyoby/PSNetMap/releases/tag/v1.0.0 [1.1.0]: https://github.com/jacobyoby/PSNetMap/compare/v1.0.0...v1.1.0 [1.2.0]: https://github.com/jacobyoby/PSNetMap/compare/v1.1.0...v1.2.0 -[unreleased]: https://github.com/jacobyoby/PSNetMap/compare/v1.4.0...HEAD +[unreleased]: https://github.com/jacobyoby/PSNetMap/compare/v1.4.1...HEAD +[1.4.1]: https://github.com/jacobyoby/PSNetMap/compare/v1.4.0...v1.4.1 [1.4.0]: https://github.com/jacobyoby/PSNetMap/compare/v1.3.0...v1.4.0 [1.3.0]: https://github.com/jacobyoby/PSNetMap/compare/v1.2.0...v1.3.0 diff --git a/NetDiagram-PS/NetDiagram-PS.psd1 b/NetDiagram-PS/NetDiagram-PS.psd1 index a64a735..dcb8bd2 100644 --- a/NetDiagram-PS/NetDiagram-PS.psd1 +++ b/NetDiagram-PS/NetDiagram-PS.psd1 @@ -1,6 +1,6 @@ @{ RootModule = 'NetDiagram-PS.psm1' - ModuleVersion = '1.4.0' + ModuleVersion = '1.4.1' GUID = 'a8f7e9c4-6d2b-4a1c-9e3f-7b8c9d0e1f2a' Author = 'Jacob Yoby' CompanyName = 'NetDiagram-PS' @@ -49,7 +49,7 @@ Tags = @('Network', 'Discovery', 'Diagram', 'SNMP', 'DrawIO', 'Topology', 'NetworkMapping', 'Cisco', 'LLDP', 'IPv6', 'NetBox', 'Visualization') LicenseUri = 'https://github.com/jacobyoby/PSNetMap/blob/main/LICENSE' ProjectUri = 'https://github.com/jacobyoby/PSNetMap' - ReleaseNotes = '1.4.0. Module split into Public/Private loader files. Dual-stack inventory, IPv6 subnet matching/ARP/DrawIO parenting, bounded IPv6 discovery (ND plus /120+ CIDR; no /64 sweep), and Import-NmapScan IPv6 hosts (IPv4 preferred on dual-stack). Get-SnmpBridgeNeighbors emits L2-FDB edges (solid teal). Invoke-SnmpWalk and SNMP credential maps accept IPv6. Export-NetBox writes IPv6 to primary_ip6 and leaves unknown reachability empty. New commands: Invoke-NetworkDiscovery, Import-NmapScan, Export-Mermaid, Export-NetBox, Export-NodeInventoryCsv, Export-Topology, Import-Topology. Reachability is tri-state with optional TCP fallback. Packaged CI smoke imports FunctionsToExport and runs offline dual-stack DrawIO via Import-Inventory.' + ReleaseNotes = '1.4.1. Literal-path fixes for inventory/SNMP inputs, all exporters, Compare-NetworkScans, and the New-NetworkDiagram wizard (paths with [] work). 1.4.0. Module split into Public/Private loader files. Dual-stack inventory, IPv6 subnet matching/ARP/DrawIO parenting, bounded IPv6 discovery (ND plus /120+ CIDR; no /64 sweep), and Import-NmapScan IPv6 hosts (IPv4 preferred on dual-stack). Get-SnmpBridgeNeighbors emits L2-FDB edges (solid teal). Invoke-SnmpWalk and SNMP credential maps accept IPv6. Export-NetBox writes IPv6 to primary_ip6 and leaves unknown reachability empty. New commands: Invoke-NetworkDiscovery, Import-NmapScan, Export-Mermaid, Export-NetBox, Export-NodeInventoryCsv, Export-Topology, Import-Topology. Reachability is tri-state with optional TCP fallback. Packaged CI smoke imports FunctionsToExport and runs offline dual-stack DrawIO via Import-Inventory.' } } } diff --git a/NetDiagram-PS/NetDiagram-PS.psm1 b/NetDiagram-PS/NetDiagram-PS.psm1 index f868e82..99301e2 100644 --- a/NetDiagram-PS/NetDiagram-PS.psm1 +++ b/NetDiagram-PS/NetDiagram-PS.psm1 @@ -13,7 +13,7 @@ Set-StrictMode -Version Latest $ErrorActionPreference = 'Stop' # Module-level variables -$script:ModuleVersion = '1.4.0' +$script:ModuleVersion = '1.4.1' # Dot-source private helpers first (so public functions can call them), # then public commands. diff --git a/examples/New-NetworkDiagram.ps1 b/examples/New-NetworkDiagram.ps1 index e138c6c..55b0d15 100644 --- a/examples/New-NetworkDiagram.ps1 +++ b/examples/New-NetworkDiagram.ps1 @@ -703,7 +703,7 @@ if ($MyInvocation.InvocationName -eq '.') { return } # Import the module $modulePath = Join-Path $PSScriptRoot '..' 'NetDiagram-PS' 'NetDiagram-PS.psd1' -if (-not (Test-Path $modulePath)) { +if (-not (Test-Path -LiteralPath $modulePath)) { Write-Host "✗ Module not found at: $modulePath" -ForegroundColor Red Write-Host " Please run this script from the examples/ folder or ensure NetDiagram-PS module is installed." -ForegroundColor Yellow exit 1 @@ -1290,8 +1290,8 @@ Write-Host "`n[5/5] Generating your network diagram..." -ForegroundColor Yellow $inventoryPath = Get-InventoryOutputPath -DiagramPath $OutputPath $topology | Export-DrawIO -OutFile $OutputPath -Force -if (Test-Path $OutputPath) { - $fileSize = (Get-Item $OutputPath).Length +if (Test-Path -LiteralPath $OutputPath) { + $fileSize = (Get-Item -LiteralPath $OutputPath).Length Write-Host " ✓ Created: $OutputPath ($fileSize bytes)" -ForegroundColor Green } @@ -1299,7 +1299,7 @@ if (Test-Path $OutputPath) { # distinct sibling inventory file (Import-Inventory dual-stack contract). $inventoryData = New-WizardInventoryObject -Nodes $nodes -Subnets $subnets -$inventoryData | ConvertTo-Json -Depth 10 | Out-File -FilePath $inventoryPath -Encoding utf8 -Force +$inventoryData | ConvertTo-Json -Depth 10 | Out-File -LiteralPath $inventoryPath -Encoding utf8 -Force Write-Host " ✓ Saved inventory: $inventoryPath" -ForegroundColor Green # Summary diff --git a/tests/NetDiagram.Tests.ps1 b/tests/NetDiagram.Tests.ps1 index 12c24a5..70bb4f0 100644 --- a/tests/NetDiagram.Tests.ps1 +++ b/tests/NetDiagram.Tests.ps1 @@ -845,6 +845,18 @@ Describe 'Get-SnmpBridgeNeighbors (#39 regression)' { '{}' | Out-File -FilePath $script:CredMapPath -Force } + It 'Reads credential map paths that contain wildcard metacharacters literally' { + $credPath = Join-Path $TestDrive 'credmap-bridge[lab].json' + '{}' | Set-Content -LiteralPath $credPath + $topology = Import-Inventory -Path $script:TestInventoryPath + Mock Invoke-SnmpWalk { @() } -ModuleName 'NetDiagram-PS' + + $null = $topology | Get-SnmpBridgeNeighbors -CredentialMapPath $credPath -TryPublic -WarningAction SilentlyContinue + + # Three BRIDGE-MIB columns per eligible node (test inventory has 3 nodes). + Should -Invoke Invoke-SnmpWalk -ModuleName 'NetDiagram-PS' -Times 9 -Exactly + } + It 'Produces edges from BRIDGE-MIB snmpwalk text for learned MACs with ARP matches' { # Simulated snmpwalk output for three BRIDGE-MIB columns: # dot1dTpFdbAddress (1.3.6.1.2.1.17.4.3.1.1) — MAC as Hex-STRING