Skip to content

Phase 1: PS7 correctness fixes - #1

Merged
exactmike merged 1 commit into
masterfrom
phase1/ps7-correctness-fixes
Aug 29, 2026
Merged

Phase 1: PS7 correctness fixes#1
exactmike merged 1 commit into
masterfrom
phase1/ps7-correctness-fixes

Conversation

@exactmike

Copy link
Copy Markdown
Collaborator

Summary

Phase 1 of plans/modernization-roadmap.md: low-risk PS7 correctness fixes, each reproduced and verified against a real GraphViz install before/after the fix.

Also removed the now-dead PSAvoidUsingInvokeExpression suppression on Export-PSGraph, since no Invoke-Expression call remains in the module.

Test plan

  • Added regression tests in Tests/Regression.Tests.ps1 (compound, SubGraph binding) and Tests/Export-PSGraph.Tests.ps1 (spaced path, ShowGraph, BOM, non-ASCII, path detection)
  • Full local Pester run: 145 passed / 9 failed, all 9 pre-existing and unrelated (3 need a built .psm1 not present in this checkout — Phase 2 CI work; 2 are pre-existing ScriptAnalyzer findings in Entity.ps1/Node.ps1 untouched by this PR)
  • PSScriptAnalyzer clean on all three changed source files
  • Manually verified each fix against a real local GraphViz install (dot - graphviz version 15.1.1) before and after the change

Claude-Session: https://claude.ai/code/session_01AgrjdhkmUCswsFGbn3EwCg

…ette#98, KevinMarquette#97, KevinMarquette#104, KevinMarquette#66, KevinMarquette#75/KevinMarquette#88/KevinMarquette#85)

- Export-PSGraph: replace Invoke-Expression with Invoke-Item for -ShowGraph
  so destination paths containing spaces work on PS7 (KevinMarquette#110/PR-102).
- Export-PSGraph: pin $OutputEncoding to UTF8-no-BOM around the pipe to
  dot's stdin so an ambient BOM-emitting encoding (e.g. in CI) can't break
  dot's parser; verified non-ASCII labels already round-trip correctly
  once the BOM is gone (KevinMarquette#97, KevinMarquette#104).
- Export-PSGraph: prefer a cross-platform `Get-Command dot` PATH lookup
  over the hardcoded path glob when -GraphVizPath isn't explicitly given;
  an explicit -GraphVizPath still wins outright (KevinMarquette#75, KevinMarquette#88, KevinMarquette#85).
- Graph: only default the compound attribute to 'true' when the caller
  hasn't already supplied one, so compound=$false survives (KevinMarquette#98).
- docs/Command-SubGraph.md: fix the documented SubGraph example to pass
  -ScriptBlock by name, matching how PowerShell's parameter-set binding
  actually resolves an unnamed subgraph with -Attributes (KevinMarquette#66).

Added regression tests for all of the above.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AgrjdhkmUCswsFGbn3EwCg
@exactmike
exactmike merged commit b68891a into master Aug 29, 2026
@exactmike exactmike mentioned this pull request Aug 29, 2026
3 tasks
@exactmike
exactmike deleted the phase1/ps7-correctness-fixes branch August 29, 2026 13:16
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