1
00:00:01,080 --> 00:00:02,540
Now before we go,

2
00:00:02,540 --> 00:00:05,370
I want to show you a few other things that you can work with in

3
00:00:05,370 --> 00:00:09,930
PowerShell that might make it easy to find commands or to even just

4
00:00:09,930 --> 00:00:12,440
navigate commands that you may have run.

5
00:00:12,440 --> 00:00:13,740
Now, first off,

6
00:00:13,740 --> 00:00:19,370
you can hit the up arrow at the prompt to go back and

7
00:00:19,370 --> 00:00:22,340
find the commands that you ran before.

8
00:00:22,340 --> 00:00:24,180
So if I want rerun that ping command,

9
00:00:24,180 --> 00:00:28,240
I can just use the up arrow to go and find the commands.

10
00:00:28,240 --> 00:00:32,970
There was also a little utility here in PowerShell that's part of a module

11
00:00:32,970 --> 00:00:38,420
called PSReadLine, and they way that this works is I can press Ctrl+R and I get

12
00:00:38,420 --> 00:00:42,940
this little search here, so it lets you know that I ran that Get‑Vegetable

13
00:00:42,940 --> 00:00:49,130
command. And you can see as soon as I started typing Get, there we go, so there

14
00:00:49,130 --> 00:00:52,480
is Get‑Verb, and if I wanted to, oh,

15
00:00:52,480 --> 00:00:57,290
that's not what I want, I want the G, there we go, so I can go back

16
00:00:57,290 --> 00:01:04,410
and I can find things with that Ctrl+R, very nice and quick and easy

17
00:01:04,410 --> 00:01:08,670
to find cmdlets I may have run before without having to retype things.

18
00:01:08,670 --> 00:01:10,120
Now, I also mentioned, you know,

19
00:01:10,120 --> 00:01:16,150
you also have tab completion. So I can do Get‑Ser and hit Tab, and it

20
00:01:16,150 --> 00:01:20,940
will auto complete, and Shift+Tab will go backwards.

21
00:01:20,940 --> 00:01:24,640
So let's go back here to Get‑Service because another fun thing here,

22
00:01:24,640 --> 00:01:29,240
the parameter name is ‑Name, that's the default.

23
00:01:29,240 --> 00:01:31,120
So it knows if I hit Tab,

24
00:01:31,120 --> 00:01:33,870
that's all I'm doing here, it is cycling through all

25
00:01:33,870 --> 00:01:36,040
of the possible service names.

26
00:01:36,040 --> 00:01:38,170
So there's a lot of cool things that PowerShell will do to

27
00:01:38,170 --> 00:01:41,930
make your life easier, you just have to get in the habit of

28
00:01:41,930 --> 00:01:43,540
using that tab completion.

29
00:01:43,540 --> 00:01:47,340
It doesn't work all the time, but it does work quite a bit.

30
00:01:47,340 --> 00:01:52,440
The last thing I want to show you here is another command called Show‑Command.

31
00:01:52,440 --> 00:01:56,340
So if you run Show‑Command all by itself,

32
00:01:56,340 --> 00:02:00,890
this will give you a GUI pop‑up of all the possible commands on

33
00:02:00,890 --> 00:02:03,740
your system, it's very similar to the Get‑Command.

34
00:02:03,740 --> 00:02:05,730
Now there's another nice benefit, though.

35
00:02:05,730 --> 00:02:13,740
I'm going to fine tune this, and let's do Get‑Service.

36
00:02:13,740 --> 00:02:18,840
Now I get all of the parameter sets, that's the technical term for

37
00:02:18,840 --> 00:02:21,550
those different ways of using it, and I can say,

38
00:02:21,550 --> 00:02:27,240
you know what, I want to find this by the, say DisplayName, and I want to find

39
00:02:27,240 --> 00:02:33,760
all the ones that start with win*. You can either run the command, which will

40
00:02:33,760 --> 00:02:39,960
paste it now into the command prompt, or I could have copied it so I could then

41
00:02:39,960 --> 00:02:43,240
paste it into some script I'm working on.

42
00:02:43,240 --> 00:02:46,470
You can also use Show‑Command right from the prompt here

43
00:02:46,470 --> 00:02:49,320
and say I want to do Show‑Command, say Get‑Vegetable,

44
00:02:49,320 --> 00:02:52,440
I'll use tab completion there.

45
00:02:52,440 --> 00:02:55,170
Now, this doesn't have too many options here.

46
00:02:55,170 --> 00:02:57,150
Let's say you know what, I just want to use that

47
00:02:57,150 --> 00:03:02,750
RootOnly. Click Run, and there we go.

48
00:03:02,750 --> 00:03:07,600
So I don't necessarily have to know all of the syntax, I can discover what the

49
00:03:07,600 --> 00:03:13,560
syntax is by using that little GUI, the Show‑Command GUI, and pick and choose

50
00:03:13,560 --> 00:03:18,370
what I need from those different options, and then PowerShell will display the

51
00:03:18,370 --> 00:03:21,240
command with all the parameters that I need.

52
00:03:21,240 --> 00:03:21,900
So it's a nice,

53
00:03:21,900 --> 00:03:28,540
handy and easy way to learn about PowerShell and how to build these commands.

54
00:03:28,540 --> 00:03:30,410
The more you spend time in PowerShell,

55
00:03:30,410 --> 00:03:33,940
the easier it will be and the more fun you're going to have.

56
00:03:33,940 --> 00:03:41,000
So, I think that's enough for looking at commands. Let's go back to the slides and wrap it all up.

