Phase B item from the #150 PSVA gap audit. Standalone since it's back-compat-safe and small.
What
Add a pipeline-friendly parameter set to Connect-VisioShape so star-topology bulk-connect works:
$shapes | Connect-VisioShape -From $sourceShape
Each shape on the pipeline becomes a connector destination from a single named source (the PSVA Add-visShapeConnection -FromShape $src pattern).
Today's shape
[SMA.Parameter(Position = 0, Mandatory = true)] IVisio.Shape[] From { get; set; }
[SMA.Parameter(Position = 1, Mandatory = true)] IVisio.Shape[] To { get; set; }
[SMA.Parameter(Position = 2, Mandatory = false)] IVisio.Master Master { get; set; }
Both From and To are [Parameter] with positions but no ValueFromPipeline = true. The cmdlet works for Connect-VisioShape $src $dst but doesn't bind from a pipeline.
Proposed shape
Add a parameter set that accepts pipeline input on To. Sketch (final shape pending design):
[SMA.Parameter(ParameterSetName = "Positional", Position = 0, Mandatory = true)] public IVisio.Shape[] From { get; set; }
[SMA.Parameter(ParameterSetName = "Positional", Position = 1, Mandatory = true)] public IVisio.Shape[] To { get; set; }
[SMA.Parameter(ParameterSetName = "Pipeline", Mandatory = true)] public IVisio.Shape FromShape { get; set; }
[SMA.Parameter(ParameterSetName = "Pipeline", Mandatory = true, ValueFromPipeline = true)] public IVisio.Shape ToShape { get; set; }
Open design questions to settle in the implementation:
- Single-source / single-destination per pipeline iteration vs. continuing to accept arrays in the pipeline set?
-Master carries through both sets? (Yes, almost certainly.)
Begin / Process / End lifecycle: batch into a single ConnectShapes(...) call at End, or call once per pipeline item? Batching is more efficient for large pipelines; per-item is more responsive.
Acceptance
Effort
S. ~1-2 hours including the test and changelog.
Themed milestone
Milestone D (Cmdlet ergonomics).
Phase B item from the #150 PSVA gap audit. Standalone since it's back-compat-safe and small.
What
Add a pipeline-friendly parameter set to
Connect-VisioShapeso star-topology bulk-connect works:Each shape on the pipeline becomes a connector destination from a single named source (the PSVA
Add-visShapeConnection -FromShape $srcpattern).Today's shape
Both
FromandToare[Parameter]with positions but noValueFromPipeline = true. The cmdlet works forConnect-VisioShape $src $dstbut doesn't bind from a pipeline.Proposed shape
Add a parameter set that accepts pipeline input on
To. Sketch (final shape pending design):Open design questions to settle in the implementation:
-Mastercarries through both sets? (Yes, almost certainly.)Begin/Process/Endlifecycle: batch into a singleConnectShapes(...)call atEnd, or call once per pipeline item? Batching is more efficient for large pipelines; per-item is more responsive.Acceptance
Connect-VisioShape $src $dstcalls still work unchanged (positional binding).VTest.PowerShellexercises the pipeline pattern: build N shapes, run$shapes | Connect-VisioShape -From $src, assert N connectors created.VisioPowerShell/CHANGELOG.md[Unreleased]entry under "Added".Effort
S. ~1-2 hours including the test and changelog.
Themed milestone
Milestone D (Cmdlet ergonomics).