1
00:00:01,040 --> 00:00:01,340
All right,

2
00:00:01,340 --> 00:00:05,360
let's break this down. And this is the process that I recommend that you follow.

3
00:00:05,360 --> 00:00:08,360
Don't try to write the final PowerShell command,

4
00:00:08,360 --> 00:00:10,710
especially when you're still learning PowerShell.

5
00:00:10,710 --> 00:00:12,800
It will most likely fail, and then you'll struggle

6
00:00:12,800 --> 00:00:14,870
to figure out what you did wrong.

7
00:00:14,870 --> 00:00:17,180
Follow this approach that I'm about to show you.

8
00:00:17,180 --> 00:00:18,440
So here's the example.

9
00:00:18,440 --> 00:00:23,040
I want to get the bits and spooler services.

10
00:00:23,040 --> 00:00:27,820
This command is going to write two service objects to the pipeline.

11
00:00:27,820 --> 00:00:32,290
That vertical bar is the pipe symbol that tells PowerShell to

12
00:00:32,290 --> 00:00:35,950
pass objects or send objects from one command on the left side,

13
00:00:35,950 --> 00:00:38,890
in this case, Get‑Service, to something else that's going to

14
00:00:38,890 --> 00:00:41,240
come up on the right side.

15
00:00:41,240 --> 00:00:46,040
So with this, the objects are going to be passed to Set‑Service.

16
00:00:46,040 --> 00:00:49,440
I want to do something with the objects.

17
00:00:49,440 --> 00:00:53,940
In this case, I want to set the startuptype to manual.

18
00:00:53,940 --> 00:00:57,740
You'll still need to have an understanding of the underlying technology.

19
00:00:57,740 --> 00:01:00,740
I mean, if you have no idea what a service is in Windows,

20
00:01:00,740 --> 00:01:04,840
you're going to have a hard time managing it with PowerShell.

21
00:01:04,840 --> 00:01:07,610
And of course, for all these commands that you're looking at,

22
00:01:07,610 --> 00:01:11,590
you need to make sure you read the help and example so that you can learn how to

23
00:01:11,590 --> 00:01:15,540
set, in this case, services, and how they're going to work.

24
00:01:15,540 --> 00:01:19,940
You can repeat this process until you are finished with your task.

25
00:01:19,940 --> 00:01:24,180
If there are no other commands, then the PowerShell pipeline finishes,

26
00:01:24,180 --> 00:01:28,240
and if there's any results, they'll be written to the pipeline.

27
00:01:28,240 --> 00:01:29,540
Now, in this example,

28
00:01:29,540 --> 00:01:33,260
Set‑Service doesn't write anything to the pipeline, so I get a new prompt.

29
00:01:33,260 --> 00:01:35,340
I get no results.

30
00:01:35,340 --> 00:01:45,000
What parameter do you think Set‑Service has if I wanted to see the results? Of course, ‑pass through.

