In Powershell, I have a list of different subroutes and I need to define all possible start/end points from the route. Let me clearify by showing an example.
This is the list of subroutes. These are all objects with a property that defines whether it is a possible starting point or not. In this example, only $A is a starting point.
$subroutes = @(
@($A, $B),
@($A, $C),
@($B, $D),
@($B, $E),
@($D, $F),
@($C, $E)
)
For example: you can go from A to B and then from B to 3 other destinations. The final result would be: - A ==> F (A to B to D to F) - A ==> E (A to B to E) OR (A to C to E)
I am quite new to Powershell and have learned a lot already, but I cannot seem to find a decent piece of code to manage this. What is the best combination of cmdlets to traverse all possible subroutes and make sure I can find all possible routes?