1
00:00:01,140 --> 00:00:04,240
All right, so let's now try to run some commands.

2
00:00:04,240 --> 00:00:08,530
So we know I have that vegetable command that we saw earlier, so let's go

3
00:00:08,530 --> 00:00:12,640
ahead and try to run Get‑Vegetable. Now, I have no idea necessarily what

4
00:00:12,640 --> 00:00:15,970
this might do, but it's a Get‑Command so it really can't do too much

5
00:00:15,970 --> 00:00:21,120
damage, so let's just find out. Okay, nothing too exciting there, it

6
00:00:21,120 --> 00:00:24,640
displays a list of vegetables.

7
00:00:24,640 --> 00:00:29,560
But once I know the pattern, let's try again with the real command,

8
00:00:29,560 --> 00:00:31,840
like Get‑Service.

9
00:00:31,840 --> 00:00:37,480
Sure enough, I get a list of services. Now if I want to, from looking at help,

10
00:00:37,480 --> 00:00:41,050
which eventually you'll learn how to use, I can say get me the bits

11
00:00:41,050 --> 00:00:47,940
service. So that retrieves just a single service.

12
00:00:47,940 --> 00:00:50,640
Let's real quickly look at help for Get‑Service,

13
00:00:50,640 --> 00:00:56,040
and you can see there that there is a ‑Name parameter,

14
00:00:56,040 --> 00:01:00,040
and there's also a ‑DisplayName parameter.

15
00:01:00,040 --> 00:01:03,020
The Name parameter, as you can see there, it's in square brackets,

16
00:01:03,020 --> 00:01:07,460
which means it is positional. DisplayName is not in square brackets,

17
00:01:07,460 --> 00:01:09,400
which means if I want to use it,

18
00:01:09,400 --> 00:01:14,210
I have to actually type the name of the parameter, and then we can

19
00:01:14,210 --> 00:01:18,040
see all the other information about the cmdlet.

20
00:01:18,040 --> 00:01:23,740
So let's do Get‑Service and we'll go ahead and explicitly use the ‑Name. It

21
00:01:23,740 --> 00:01:26,690
works just fine, and in some ways that's a little nice because I know

22
00:01:26,690 --> 00:01:29,740
exactly what it is that PowerShell wants to do.

23
00:01:29,740 --> 00:01:34,980
But I could also use the DisplayName parameter and find me all the services

24
00:01:34,980 --> 00:01:40,180
that have micro* as part of the DisplayName, and it turned out that works as

25
00:01:40,180 --> 00:01:44,670
you would expect. I want to point out, by the way,

26
00:01:44,670 --> 00:01:48,950
that PowerShell is a shell, so I can run other tools

27
00:01:48,950 --> 00:01:50,690
as well, even command line tools.

28
00:01:50,690 --> 00:01:56,540
I can run things like tasklist, the command line way of looking at processes.

29
00:01:56,540 --> 00:02:00,030
I can ping things. So the ping command will work.

30
00:02:00,030 --> 00:02:02,680
I'm just going to ping the localhost.

31
00:02:02,680 --> 00:02:10,740
I can use stuff like nslookup and try to resolve a DNS name, that works as well.

32
00:02:10,740 --> 00:02:10,990
Now,

33
00:02:10,990 --> 00:02:15,780
eventually you'll learn the PowerShell equivalents for those commands, but

34
00:02:15,780 --> 00:02:19,740
if you need or rely on those commands to do your job,

35
00:02:19,740 --> 00:02:22,170
you can do them right from PowerShell.

36
00:02:22,170 --> 00:02:22,650
In fact,

37
00:02:22,650 --> 00:02:27,230
you can use PowerShell's Run‑Any command once you know the command line for it.

38
00:02:27,230 --> 00:02:28,160
For example,

39
00:02:28,160 --> 00:02:32,970
I can run Notepad, or if I wanted to I can open up the Control

40
00:02:32,970 --> 00:02:36,040
Panel because I know that that is control.

41
00:02:36,040 --> 00:02:40,690
So I can navigate through a lot of my Windows stuff right from PowerShell.

42
00:02:40,690 --> 00:02:41,240
Personally,

43
00:02:41,240 --> 00:02:44,730
I use a PowerShell window all the time to do everything

44
00:02:44,730 --> 00:02:46,480
that I need to do throughout my day,

45
00:02:46,480 --> 00:02:50,410
I have learned all the command line tools, so I just find it faster to

46
00:02:50,410 --> 00:02:55,140
just type the command than to go searching for it through the start

47
00:02:55,140 --> 00:03:00,000
panel or shortcuts or anything like that. I just type it out and I'm good to go.

