1
00:00:01,130 --> 00:00:05,290
Alright, so let's look at how to use help in a little more detail here.

2
00:00:05,290 --> 00:00:08,640
So we know we can run a command like help get‑service,

3
00:00:08,640 --> 00:00:13,860
and we can see PARAMETERS, and we'll also scroll down here,

4
00:00:13,860 --> 00:00:17,540
you can see NOTES and all the examples.

5
00:00:17,540 --> 00:00:22,150
Now this is the same behavior that you can get with the help

6
00:00:22,150 --> 00:00:26,140
command that has a parameter called ‑full.

7
00:00:26,140 --> 00:00:30,920
And this will show you everything that there is about help.

8
00:00:30,920 --> 00:00:33,880
Now for some reason in PowerShell 7,

9
00:00:33,880 --> 00:00:37,620
it looks like the new default is to show you full commands,

10
00:00:37,620 --> 00:00:41,180
although I have seen some systems where it doesn't

11
00:00:41,180 --> 00:00:46,040
always show full help all the time, and I can't figure out why that is.

12
00:00:46,040 --> 00:00:50,330
So if you want to see full help, it doesn't hurt to run help,

13
00:00:50,330 --> 00:00:52,210
the name the command, ‑full,

14
00:00:52,210 --> 00:00:57,420
and then you'll know you'll always get the full help and examples.

15
00:00:57,420 --> 00:01:00,420
Those examples are very important.

16
00:01:00,420 --> 00:01:04,830
There is also an option here with the help command called ‑ShowWindow,

17
00:01:04,830 --> 00:01:09,340
and when you run this, this will display the help,

18
00:01:09,340 --> 00:01:13,170
and it doesn't always pop up here, but if I look behind here,

19
00:01:13,170 --> 00:01:17,310
I have a graphical window, let's make this bigger.

20
00:01:17,310 --> 00:01:24,660
What's nice here is that you can zoom in and make the font size bigger.

21
00:01:24,660 --> 00:01:28,060
There is like search, so I wanted to say search for name,

22
00:01:28,060 --> 00:01:30,840
you can say get some nice highlighting.

23
00:01:30,840 --> 00:01:31,930
Now the output,

24
00:01:31,930 --> 00:01:34,640
and the way that this is displayed may be different

25
00:01:34,640 --> 00:01:39,230
than what you see on the screen, so the order isn't always the same,

26
00:01:39,230 --> 00:01:41,370
and you can control or filter,

27
00:01:41,370 --> 00:01:45,360
you know what types of help content that you want to see.

28
00:01:45,360 --> 00:01:51,380
It's a really handy a little tool because you can do help ‑ShowWindow,

29
00:01:51,380 --> 00:01:53,870
pull the window if you have multiple monitors,

30
00:01:53,870 --> 00:01:56,750
pull this little display over to one monitor,

31
00:01:56,750 --> 00:01:59,050
and then you have your other monitor to be working,

32
00:01:59,050 --> 00:02:01,200
so you can look, you can look back and forth.

33
00:02:01,200 --> 00:02:04,110
I find that really quite helpful.

34
00:02:04,110 --> 00:02:06,480
I feel like there's lots of gotchas or potential

35
00:02:06,480 --> 00:02:08,840
gotchas I got to tell you about, but yeah,

36
00:02:08,840 --> 00:02:09,490
there are.

37
00:02:09,490 --> 00:02:14,940
So one thing about the ‑ShowWindow is that,

38
00:02:14,940 --> 00:02:18,820
remember I mentioned earlier that all the PowerShell help gets

39
00:02:18,820 --> 00:02:22,840
formatted in these kind of fancy XML files.

40
00:02:22,840 --> 00:02:28,990
When you do ‑ShowWindow, PowerShell kind of has to massage or reformat that

41
00:02:28,990 --> 00:02:34,670
XML data to display properly in this graphical display.

42
00:02:34,670 --> 00:02:38,740
Sometimes the XML gets a little mangled,

43
00:02:38,740 --> 00:02:40,170
gets a little torqued,

44
00:02:40,170 --> 00:02:44,090
and PowerShell, from the console, usually can display just fine, but

45
00:02:44,090 --> 00:02:49,950
sometimes you'll get kind of weird things with help when you're using

46
00:02:49,950 --> 00:02:55,080
‑ShowWindow. So just be aware of that. I think I have a demo of that a

47
00:02:55,080 --> 00:02:59,990
little bit later. So let's close that, and let's come back to the prompt

48
00:02:59,990 --> 00:03:03,820
here, and let's do help get‑process.

49
00:03:03,820 --> 00:03:07,740
Here's another example, we can see I'm getting NAME, SYNTAX,

50
00:03:07,740 --> 00:03:12,340
SYNOPSIS, DESCRIPTION, then all the parameters.

51
00:03:12,340 --> 00:03:14,320
Well sometimes what you might want to do though,

52
00:03:14,320 --> 00:03:15,160
is say, you know,

53
00:03:15,160 --> 00:03:18,600
I don't need to see all that, I'm just curious about a particular

54
00:03:18,600 --> 00:03:22,180
parameter. So you can run help name of the command, let's go back to

55
00:03:22,180 --> 00:03:26,710
get‑service, say just show me all the name parameter.

56
00:03:26,710 --> 00:03:30,960
Now I can see, and focus really just on that parameter.

57
00:03:30,960 --> 00:03:36,180
So the name parameter specifies the service name of the service to be retrieved.

58
00:03:36,180 --> 00:03:41,640
Okay, that seems pretty simple, and wild cards are allowed.

59
00:03:41,640 --> 00:03:42,610
Now you can also,

60
00:03:42,610 --> 00:03:45,360
with the ‑ parameter, you can also use wild cards

61
00:03:45,360 --> 00:03:46,990
that actually, as part of the name.

62
00:03:46,990 --> 00:03:48,810
So say hey,

63
00:03:48,810 --> 00:03:53,580
for get‑service, show me all the parameters that are *name.

64
00:03:53,580 --> 00:03:57,690
So, I can see I get ‑DisplayName and ‑Name.

65
00:03:57,690 --> 00:04:02,330
So let's clear the screen here, and the last thing to show you here with get

66
00:04:02,330 --> 00:04:08,850
help are the examples. You saw when you do ‑Full, you get all the examples, if

67
00:04:08,850 --> 00:04:12,390
all you want to see are the examples, just do help,

68
00:04:12,390 --> 00:04:15,980
the name the command, and then ‑Examples.

69
00:04:15,980 --> 00:04:18,170
This then shows you, so it gives you the name of

70
00:04:18,170 --> 00:04:20,240
synopsis, but then it will go through,

71
00:04:20,240 --> 00:04:22,760
and PowerShell will display just the example.

72
00:04:22,760 --> 00:04:27,000
So you can see how do I use this particular command.

73
00:04:27,000 --> 00:04:30,440
That could be really quite handy.

74
00:04:30,440 --> 00:04:34,800
Another potential gotcha though, the quality of the help and the number of those

75
00:04:34,800 --> 00:04:38,850
examples really depend upon the team or the author who is responsible for that

76
00:04:38,850 --> 00:04:43,440
cmdlet or the documentation. Now here's an example of a command that I have, I

77
00:04:43,440 --> 00:04:46,900
expect you do too, enable‑storagebusdisk.

78
00:04:46,900 --> 00:04:54,290
And if I do ‑full help, you can see there's the SYNTAX and PARAMETERS.

79
00:04:54,290 --> 00:05:00,260
There's no DESCRIPTION, and there are no examples, so there's nothing I can do.

80
00:05:00,260 --> 00:05:02,860
If I need more information about how to use this command,

81
00:05:02,860 --> 00:05:05,530
I'm gonna have to go online and asking people, hey,

82
00:05:05,530 --> 00:05:09,010
I don't understand this particular parameter or whatever because

83
00:05:09,010 --> 00:05:12,840
the help documentation is not fully fleshed out.

84
00:05:12,840 --> 00:05:16,400
It's unfortunate that some commands, for whatever reason,

85
00:05:16,400 --> 00:05:20,270
don't have all the help that other commands do, but the only

86
00:05:20,270 --> 00:05:22,370
way you're going to know that is by looking.

87
00:05:22,370 --> 00:05:27,750
Just don't be surprised if you don't see what you are

88
00:05:27,750 --> 00:05:33,670
expecting. Now PowerShell will generate pretty much basic help

89
00:05:33,670 --> 00:05:36,620
based on command metadata and parameters,

90
00:05:36,620 --> 00:05:40,790
so you should always at least be able to see, when you do help for a command,

91
00:05:40,790 --> 00:05:44,570
even if has no documentation shipping with it, it should still at

92
00:05:44,570 --> 00:05:47,780
least show you the syntax, so you can see what the parameters are

93
00:05:47,780 --> 00:05:49,990
and how to use that particular command.

94
00:05:49,990 --> 00:05:57,000
You just may not get all the extra bonuses with parameter information and examples.

