1
00:00:00,140 --> 00:00:04,020
Now, the critical and the most important thing about all of these options,

2
00:00:04,020 --> 00:00:06,100
whether it's an If statement or an If/Else,

3
00:00:06,100 --> 00:00:09,440
etc., it's all about managing the flow.

4
00:00:09,440 --> 00:00:13,060
So If statements can be nested within each other to

5
00:00:13,060 --> 00:00:15,720
create really complex execution paths.

6
00:00:15,720 --> 00:00:20,650
Loop statements can also be nested inside loop statements as well,

7
00:00:20,650 --> 00:00:22,330
as well as other If statements.

8
00:00:22,330 --> 00:00:27,060
The ForEach is not only a function for enumeration,

9
00:00:27,060 --> 00:00:31,090
but is also a property that's available on specific types of objects,

10
00:00:31,090 --> 00:00:34,540
so not every object type has a ForEach.

11
00:00:34,540 --> 00:00:37,410
And then, of course, all combinations of If,

12
00:00:37,410 --> 00:00:40,220
ElseIf, Else, Switch, Do‑While, Do‑Until,

13
00:00:40,220 --> 00:00:45,640
While, For‑Each, and Switch statements are supported within each other.

14
00:00:45,640 --> 00:00:48,430
So if you think of some kind of really complex logic here,

15
00:00:48,430 --> 00:00:52,800
you could have a massive If/Else If/Else statement with a bunch of

16
00:00:52,800 --> 00:00:57,690
Switch statements in between that the execution paths are loops to do

17
00:00:57,690 --> 00:01:05,000
various things. So you can combine all of these together to help you manage the flow within PowerShell.

