1
00:00:00,940 --> 00:00:04,730
That brings us to the end of this module on formatting with PowerShell.

2
00:00:04,730 --> 00:00:08,360
But before I let you dive back into the PowerShell console to keep

3
00:00:08,360 --> 00:00:13,140
experimenting and exploring, and believe me, I really want you to do that,

4
00:00:13,140 --> 00:00:16,340
there are a few key takeaways I want to leave you with.

5
00:00:16,340 --> 00:00:21,740
Firstly, formatting can be used explicitly, but it's often used implicitly.

6
00:00:21,740 --> 00:00:24,890
It's good to remember that PowerShell does a pretty good job

7
00:00:24,890 --> 00:00:27,640
of formatting by default out of the box.

8
00:00:27,640 --> 00:00:31,490
The rules that PowerShell follows have been thought out well to aim to

9
00:00:31,490 --> 00:00:34,800
give you the most relevant information in a way that's easily

10
00:00:34,800 --> 00:00:38,340
digestible by a human reading it on the screen.

11
00:00:38,340 --> 00:00:41,440
Most of the time it may get you what you need.

12
00:00:41,440 --> 00:00:44,860
Secondly, the formatting system, look, it can be complex,

13
00:00:44,860 --> 00:00:47,440
but honestly, don't let that worry you.

14
00:00:47,440 --> 00:00:50,220
I know we picked under the covers a bit there to take a look at

15
00:00:50,220 --> 00:00:53,370
the raw formatting data and the XML output.

16
00:00:53,370 --> 00:00:55,780
And when you get more experience with PowerShell,

17
00:00:55,780 --> 00:00:59,680
you may go on to write your own custom format views and definitions.

18
00:00:59,680 --> 00:01:00,660
But for now,

19
00:01:00,660 --> 00:01:03,610
it's not really something you have to care too much about.

20
00:01:03,610 --> 00:01:06,820
Just being aware that it's there is more than enough to get

21
00:01:06,820 --> 00:01:09,340
you through your day‑to‑day usage.

22
00:01:09,340 --> 00:01:12,920
If the default formatting isn't quite getting you what you're after,

23
00:01:12,920 --> 00:01:15,610
you are now armed with everything you need to get up and

24
00:01:15,610 --> 00:01:18,100
running with formatting data to tables,

25
00:01:18,100 --> 00:01:21,640
lists, and to that wide format we looked at as well.

26
00:01:21,640 --> 00:01:24,800
You can't break anything by playing around with the formatting of data,

27
00:01:24,800 --> 00:01:27,470
so please, if you haven't done so already,

28
00:01:27,470 --> 00:01:30,470
get your PowerShell console out and start exploring and

29
00:01:30,470 --> 00:01:33,740
experimenting with these different format commands.

30
00:01:33,740 --> 00:01:36,470
This is very much like anything in PowerShell,

31
00:01:36,470 --> 00:01:39,060
in fact, pretty much like anything in life.

32
00:01:39,060 --> 00:01:40,350
The more you use it,

33
00:01:40,350 --> 00:01:42,800
the better you'll become at using it and the more

34
00:01:42,800 --> 00:01:44,640
familiar you'll become with it.

35
00:01:44,640 --> 00:01:45,660
Before you know it,

36
00:01:45,660 --> 00:01:50,430
you'll be automatically piping data to fl for lists and ft for tables

37
00:01:50,430 --> 00:01:54,040
to get the exact output you want when you want it.

38
00:01:54,040 --> 00:01:56,030
I want to leave you with a couple of key points

39
00:01:56,030 --> 00:01:58,440
about the PowerShell format system.

40
00:01:58,440 --> 00:02:03,080
Always remember that the format cmdlets format data. They are not

41
00:02:03,080 --> 00:02:06,540
responsible for getting that data out of the pipeline.

42
00:02:06,540 --> 00:02:09,930
That is the job of the out cmdlets. And without you knowing it,

43
00:02:09,930 --> 00:02:14,140
Out‑Default and Out‑Host are being appended to your commands.

44
00:02:14,140 --> 00:02:14,930
Finally,

45
00:02:14,930 --> 00:02:18,390
leave your formatting until last, or as we spoke about in the

46
00:02:18,390 --> 00:02:21,440
previous clip, leave formatting to the right.

47
00:02:21,440 --> 00:02:22,390
That is to say,

48
00:02:22,390 --> 00:02:25,540
formatting should be the very last thing you do with data in your

49
00:02:25,540 --> 00:02:29,840
pipeline unless you're piping it to an out cmdlet.

50
00:02:29,840 --> 00:02:34,400
Speaking of those out cmdlets, that's a perfect segue into what's coming up next,

51
00:02:34,400 --> 00:02:43,000
which is a module on working with the out cmdlets in PowerShell. I hope you've enjoyed this module, and I can't wait to see you in the next one.

