1
00:00:01,040 --> 00:00:04,670
So let me jump into Windows and show you how easy it

2
00:00:04,670 --> 00:00:07,840
really is to install PowerShell 7.

3
00:00:07,840 --> 00:00:08,140
All right,

4
00:00:08,140 --> 00:00:11,260
so I'm on my Windows 10 desktop and I've opened up a

5
00:00:11,260 --> 00:00:15,140
Windows PowerShell 5.1 session,

6
00:00:15,140 --> 00:00:19,180
and we can verify that by looking at the $PSversiontable variable.

7
00:00:19,180 --> 00:00:22,240
So, yes, I am running Windows PowerShell.

8
00:00:22,240 --> 00:00:24,990
Now before we get to installing PowerShell 7,

9
00:00:24,990 --> 00:00:31,110
let's go to the GitHub repo, and I'll do this here from PowerShell because I

10
00:00:31,110 --> 00:00:35,040
want to show you what you want to look at when you go here.

11
00:00:35,040 --> 00:00:40,140
So you're going to scroll down and go and look at the README file here.

12
00:00:40,140 --> 00:00:43,540
This section here, this Get PowerShell section, this is the important part.

13
00:00:43,540 --> 00:00:47,240
This shows you all the platforms where you can install it.

14
00:00:47,240 --> 00:00:50,120
You can also download the particular packages,

15
00:00:50,120 --> 00:00:55,380
such as an MSI file or a ZIP file, and there are instructions that you

16
00:00:55,380 --> 00:01:00,010
can follow for the different platforms. So you can install PowerShell

17
00:01:00,010 --> 00:01:03,330
7 right manually from the GitHub repo,

18
00:01:03,330 --> 00:01:08,640
or I'm going to show you a way that I do it using a PowerShell command.

19
00:01:08,640 --> 00:01:12,440
So let's close this and go back here to PowerShell.

20
00:01:12,440 --> 00:01:17,450
Now, there's a module on the PowerShell Gallery called PSRelease Tools.

21
00:01:17,450 --> 00:01:20,730
This is something I wrote a couple years ago when PowerShell Core first came

22
00:01:20,730 --> 00:01:24,130
out, and we're going to check to see here what is available.

23
00:01:24,130 --> 00:01:28,050
You may see a different version. So, that is the version, I

24
00:01:28,050 --> 00:01:33,240
know it's not installed on my machine, so I'm going to go ahead and install it.

25
00:01:33,240 --> 00:01:36,540
We'll do Install‑Module PSReleaseTools.

26
00:01:36,540 --> 00:01:39,600
You may get prompted to install a new version of NuGet,

27
00:01:39,600 --> 00:01:45,000
or you may see a prompt like this because the PowerShell Gallery is not trusted.

28
00:01:45,000 --> 00:01:49,540
I will get this prompt and I will go ahead and trust it,

29
00:01:49,540 --> 00:01:53,240
so it will now go and download and install that module.

30
00:01:53,240 --> 00:01:55,460
You can see it goes pretty quickly.

31
00:01:55,460 --> 00:02:00,940
In that module, there is a command called Get‑PSReleaseCurrent,

32
00:02:00,940 --> 00:02:05,380
and this will show me the current release, the current stable

33
00:02:05,380 --> 00:02:08,340
release, that is, from the GitHub repo.

34
00:02:08,340 --> 00:02:12,940
And as you can see, that is version 7 of PowerShell 7.

35
00:02:12,940 --> 00:02:14,150
Within the module,

36
00:02:14,150 --> 00:02:18,220
I have a command called Get‑PSReleaseAsset, and you can look at help

37
00:02:18,220 --> 00:02:23,900
if you know some Windows PowerShell to retrieve the download files

38
00:02:23,900 --> 00:02:29,500
directly from PowerShell. So I can run Get‑PSReleaseAsset, and

39
00:02:29,500 --> 00:02:32,710
there's a parameter for the Windows Family, and say all I care about

40
00:02:32,710 --> 00:02:35,540
are the 64‑bit packages.

41
00:02:35,540 --> 00:02:41,670
So there is a package for an MSI and also for the ZIP.

42
00:02:41,670 --> 00:02:46,640
So, what I can do is if I wanted to I could download that MSI file and

43
00:02:46,640 --> 00:02:49,500
then manually install it, and I might do it like this.

44
00:02:49,500 --> 00:02:54,440
I might make a directory for the PS7 files,

45
00:02:54,440 --> 00:03:00,240
and then I can do my Get‑PSReleaseAsset for the Windows Family, the 64

46
00:03:00,240 --> 00:03:05,370
bit, in this case also limit the format to just MSI, and then pipe that

47
00:03:05,370 --> 00:03:08,790
to Save‑PSReleaseAsset and then the path.

48
00:03:08,790 --> 00:03:11,240
Now I'm including ‑WhatIf because I don't really want

49
00:03:11,240 --> 00:03:14,170
to download and install it this way.

50
00:03:14,170 --> 00:03:15,000
Instead,

51
00:03:15,000 --> 00:03:21,410
the easy way is to use Install‑PowerShell. This will install the

52
00:03:21,410 --> 00:03:28,420
latest PowerShell 7 version on Windows. So really quickly, it's as

53
00:03:28,420 --> 00:03:32,880
simple as typing Install‑PowerShell, I want to enable PowerShell

54
00:03:32,880 --> 00:03:37,080
remoting and I want to enable the context menu so that I get that in

55
00:03:37,080 --> 00:03:45,080
Explorer, and press Enter. This now is going to download and install

56
00:03:45,080 --> 00:03:48,160
PowerShell. Well, in my particular case,

57
00:03:48,160 --> 00:03:51,040
there is a Mode parameter.

58
00:03:51,040 --> 00:03:54,900
You can specify whether you want the full MSI package installation,

59
00:03:54,900 --> 00:03:58,150
which is what I'm going to get because I didn't specify either

60
00:03:58,150 --> 00:04:02,190
quiet or passive. You can use this command.

61
00:04:02,190 --> 00:04:07,720
What I like about it is I can install PowerShell 7 with all my

62
00:04:07,720 --> 00:04:10,600
parameters quietly, basically in the background.

63
00:04:10,600 --> 00:04:14,490
So, I have other laptops that I use and I just kick off

64
00:04:14,490 --> 00:04:18,360
this task and install PowerShell 7 completely unattended,

65
00:04:18,360 --> 00:04:20,140
not to have to deal with it.

66
00:04:20,140 --> 00:04:24,010
If you have your own MSI or own software deployment tools or

67
00:04:24,010 --> 00:04:27,840
mechanisms, certainly go ahead and use those.

68
00:04:27,840 --> 00:04:30,230
So, we're going to let this finish downloading,

69
00:04:30,230 --> 00:04:35,820
and we'll be back in a few minutes when it completes, and when it completes,

70
00:04:35,820 --> 00:04:39,080
it will start the PowerShell 7 installation.

71
00:04:39,080 --> 00:04:43,240
So I'll be back in just a moment.

72
00:04:43,240 --> 00:04:43,810
All right,

73
00:04:43,810 --> 00:04:49,210
so the download finished and the GUI part of the installation has kicked off,

74
00:04:49,210 --> 00:04:53,120
so I want you to see what this looks like. So we'll go ahead and click Next.

75
00:04:53,120 --> 00:04:58,840
Really not that more difficult than any other application you've ever installed.

76
00:04:58,840 --> 00:05:03,840
We'll go ahead and accept the defaults. There's really no reason to change that.

77
00:05:03,840 --> 00:05:06,450
And I want to enable all of these things.

78
00:05:06,450 --> 00:05:08,220
I want PowerShell remoting enabled.

79
00:05:08,220 --> 00:05:12,000
Now, I've got some of these clicked because I included that in my parameters.

80
00:05:12,000 --> 00:05:17,640
But if not, I would check that here. And let's go ahead and click Next,

81
00:05:17,640 --> 00:05:24,200
Install. This takes but just a moment. And it's done. Now,

82
00:05:24,200 --> 00:05:27,000
I sped things up a little bit so you didn't have to watch the

83
00:05:27,000 --> 00:05:30,280
progress bar creep along, but it does not take that long, and

84
00:05:30,280 --> 00:05:32,800
now PowerShell 7 is set up.

85
00:05:32,800 --> 00:05:35,010
I'm not going to install it right from here, I'm going to

86
00:05:35,010 --> 00:05:37,930
leave that Launch PowerShell unchecked,

87
00:05:37,930 --> 00:05:43,370
but we'll go ahead and click Finish. And now we'll go ahead and

88
00:05:43,370 --> 00:05:46,380
just clear the host here. And to show you that I can get into

89
00:05:46,380 --> 00:05:49,150
PowerShell 7, I can run it right from here.

90
00:05:49,150 --> 00:05:55,660
I can type pwsh, press Enter, and actually, as you can see, that did not work.

91
00:05:55,660 --> 00:05:58,610
And I've shown that because you may think, oh, I'll

92
00:05:58,610 --> 00:06:00,960
just type pwsh and it will work.

93
00:06:00,960 --> 00:06:01,180
Well,

94
00:06:01,180 --> 00:06:04,120
what's happened is we wanted to do the install that modified the

95
00:06:04,120 --> 00:06:09,370
environment path so that PowerShell 7 can be detected This instance of

96
00:06:09,370 --> 00:06:14,200
Windows PowerShell doesn't know about that new change, so it can't find

97
00:06:14,200 --> 00:06:19,810
pwsh in the path. So I'll have to start a new PowerShell session in order

98
00:06:19,810 --> 00:06:24,790
for this to work. To show you what I'm talking about, now that I've

99
00:06:24,790 --> 00:06:29,140
restarted PowerShell, now I can run pwsh and you can see that I have

100
00:06:29,140 --> 00:06:31,900
started PowerShell 7.

101
00:06:31,900 --> 00:06:34,430
We'll get into more about running and working with

102
00:06:34,430 --> 00:06:36,640
PowerShell 7 in another module.

103
00:06:36,640 --> 00:06:41,040
But, I do want to show you this little link here.

104
00:06:41,040 --> 00:06:44,990
Don't just ignore it, go ahead and look at it.

105
00:06:44,990 --> 00:06:51,100
So let's do start and I just copy and paste that there because this is a very

106
00:06:51,100 --> 00:06:54,980
important page a lot of people don't go and look at. This has everything you

107
00:06:54,980 --> 00:06:59,060
need to know about PowerShell. There's documentation, there's tools, there

108
00:06:59,060 --> 00:07:05,070
are editors, gallery, related information, community resources, so I want to

109
00:07:05,070 --> 00:07:08,430
make sure you know that this exists and you take some time to look through

110
00:07:08,430 --> 00:07:09,760
this. Bookmark this.

111
00:07:09,760 --> 00:07:13,590
This is a great resource that you should be using. A lot of people

112
00:07:13,590 --> 00:07:17,470
aren't aware of it. Microsoft tells you about it right here when

113
00:07:17,470 --> 00:07:20,900
you start PowerShell, but a lot people just are in a hurry to get

114
00:07:20,900 --> 00:07:22,090
going and they miss that.

115
00:07:22,090 --> 00:07:24,660
So I think you'll find that very useful.

116
00:07:24,660 --> 00:07:31,640
When you're done, we'll just do exit, and exit to go back to Windows.

117
00:07:31,640 --> 00:07:36,260
All right, so that is how easy it is to install PowerShell 7.

118
00:07:36,260 --> 00:07:41,090
Coming up, we'll look at more about how you can get around in PowerShell 7

119
00:07:41,090 --> 00:07:43,890
and start discovering what you can do in PowerShell 7.

120
00:07:43,890 --> 00:07:48,000
But that's it for this demo, so let's go back to the slides and wrap up this module.

