Now, the critical and the most important thing about all of these options,
whether it's an If statement or an If/Else,
etc., it's all about managing the flow.
So If statements can be nested within each other to
create really complex execution paths.
Loop statements can also be nested inside loop statements as well,
as well as other If statements.
The ForEach is not only a function for enumeration,
but is also a property that's available on specific types of objects,
so not every object type has a ForEach.
And then, of course, all combinations of If,
ElseIf, Else, Switch, Do‑While, Do‑Until,
While, For‑Each, and Switch statements are supported within each other.
So if you think of some kind of really complex logic here,
you could have a massive If/Else If/Else statement with a bunch of
Switch statements in between that the execution paths are loops to do
various things. So you can combine all of these together to help you manage the flow within PowerShell.