I have a requirement to combine outputs of multiple Power Shell scripts to be given as pipeline output using CmdLets in .NET.
For example :
Command-GetA -combine Command-GetB | Command-GetD
So I want to send outputs of GetA
and GetB
to GetD
via pipeline. Is there a compact way to do this using powershell scripts or .NET cmdlets? Other than ways like storing the outputs in an array and then passing it to pipeline?
Another complex example could be:
Command-GetA -combine ( Command-GetB | Command-GetD ) | Command-GetF
This should combine GetA
and GetB|GetD
to send as pipeline input to GetF
EDIT:
It would be good if I could do something like this - @( GetA ; GetB) -ConvertToASingleList | GetC
So OutputOfGetA
and OutputOfGetB
shouldn't get called separately on GetC
. Both should, as a combined array or list object, be passed to GetC