In a previous video, I discussed the difference between the Command Prompt
and PowerShell in Windows. And if you've ever gone to use PowerShell,
you may have noticed that there's a little message that it shows every time at the top
when you run it that says, "Install the latest PowerShell for new features and improvements."
Now that new version they're talking about is PowerShell Core, it's sometimes called,
also PowerShell 7 is the latest diversion number for it. And the names are kind of confusing,
so that's one thing I'm gonna explain. Now, one thing you might be wondering
is if they're pushing so hard for you to install this latest version, why don't
they just update your version of PowerShell automatically and give you the latest version?
That's another thing I'll explain. Now before getting into everything, quickly I wanna mention
that I'm not gonna get into the super nitty gritty details about all the differences between the two
versions. I'm mostly gonna stick to more higher level, major differences, and if you want to look
up all the little details, I'll post a link for that in the description and mention it later.
Alright so now let's get into the seemingly different versions of PowerShell. So you may
have heard several terms, you may have heard Windows PowerShell or also PowerShell Core,
I already mentioned that myself. Also just PowerShell. And the important thing to understand
is all of these do refer to the same piece of software, it's all PowerShell,
just different versions of it, different stages of development.
And there is a reason for them having different names, which I'll go over. So like I touched on,
PowerShell is the general term for the software. So it's sort of like saying iOS or Android,
you might be talking about a specific version like iOS 16 or
Android 10, but you can also just be referring to the whole thing.
And at the moment there are seven different major versions of PowerShell. The latest being
PowerShell 7. Now as you know, Windows includes PowerShell when you install it,
it's pre-installed and what you might not have noticed, though,
you can tell me, is if you go to run PowerShell, it says Windows PowerShell.
It doesn't just say PowerShell, and you might think what's the difference? Is there? Well, yes,
there is a difference and it is significant. You see PowerShell is not just included with
Windows. It is its own piece of software. If you went to the GitHub page where Microsoft
posts the source code for the new PowerShell, you can go and download it and install it
onto your computer. But if you do go to install it, it will just show up as
PowerShell, not Windows PowerShell. Windows PowerShell specifically refers to the
install that came with Windows. It's considered a component
of your Windows installation. Now Windows PowerShell is the same software as PowerShell.
It's just an older version, it's a more stable version that Microsoft decided,
"Okay with Windows 10, for example, we're going to include this version of PowerShell," in this
case version 5.1 is what's included with Windows 10 and Windows 11. So
if you're running Windows PowerShell, it is just PowerShell 5.1, and that's included with Windows,
so they call it Windows PowerShell. But the important thing to know is it's not
gonna be the very latest version of PowerShell unless in the future,
there's a brand new version of Windows and they decide to include the latest
major version of PowerShell, but at the moment that's not the case. But why is this?
Why keep this separate older version of PowerShell in Windows that you never add features to, and
still promote this newer version of PowerShell? Why even keep this difference up? Well,
imagine you're a very big company and you're running some old version of Windows,
like XP, God forbid, and you decide, "Alright you know what?
We're finally gonna bite the bullet and just upgrade all our systems to Windows 11. We're gonna
rewrite our entire infrastructure around Windows and that's going to include a lot of PowerShell
scripts. So when we deploy new computers, it's gonna use a PowerShell script to install all
the software. And we're also gonna teach all of our IT admins the different commands and
configurations we want to use, and we're gonna use PowerShell to do that." And in such a real
scenario, it's likely that the company does not exactly care about having all the latest
nice features. They are going to absolutely prioritize the stuff just continuing to work.
If you're putting all these resources into creating scripts and teaching
your IT how to use PowerShell on this particular version and then
Microsoft goes and creates multiple updates for PowerShell that's all these new major versions
that change things and may break things. Well then that's not very appealing if
every few years you're gonna have to rewrite all your scripts, and you don't really have a choice
in it. So instead when Microsoft goes to release a major version of Windows, like Windows 11, they'll
say, "Okay you know what, we're gonna release PowerShell 5.1 along with Windows and build it in.
And then we're also going to support that specific version of PowerShell,
as long as we support Windows 11, cause we're gonna include it as a component." And of course,
Microsoft is going to continue to develop PowerShell and add features for the future.
And they'll release that as its own separate software, for people who do happen to want to
have the latest version with the latest features, they can choose to go and install that themselves.
And again, it will be alongside Windows PowerShell, which will stay the same. But
the important thing is even though they're not gonna be adding new features or upgrading anything
major, well, they're still going to support it in terms of creating bug fixes and security updates.
So that way companies that invest a bunch of resources into creating an infrastructure around
this version of PowerShell, they know that they can keep doing that because Microsoft
will keep supporting it. And they don't have to use the newer version that might not work
with what they make. Alright so now we can get into what the heck PowerShell
Core is. So the first thing you need to understand is that
all the way up to PowerShell version five, it was written on a software framework called the
.NET framework. And just think of this, like the underlying architecture of the software,
not gonna get into too many more details than that. But starting with PowerShell 6,
Microsoft rewrote PowerShell in a new framework or architecture, which was
.NET Core. And it's actually technically a subset of the .NET framework, but not gonna
get into that, it's a new architecture, just think of it that way. And there were several
improvements. One very notable one is that where PowerShell before could only run on Windows,
now PowerShell 6 and forward, aKA PowerShell Core because they run on .NET Core,
those are actually able to run and be installed on not just Windows, but also Linux and MacOS
as well. So now PowerShell is completely cross platform and also Microsoft decided to
make PowerShell Core open source. So you can go and look at the source code on GitHub if
you wanted to. Now, when Microsoft went to release PowerShell 6, they decided
"Alright behind the scenes, there are enough major differences with this
and also enough compatibility differences, some things don't exactly work as they used to with
PowerShell 5. We'd better add something to the name to signify it's a little bit different.
So they decided to call it PowerShell Core 6 because it's written on the .NET Core framework.
So basically just to let people know that this is more than a typical
version update. However, all that being said, when they released PowerShell 7, they decided to just
drop the Core naming scheme and just call it PowerShell again. Or if you want to include
the version name, just PowerShell 7. And a big part of that is when they went from 6 to 7,
they improved a lot of the compatibility issues.
So it was a lot easier to get stuff that you were doing on 5
to work with 7. Though, there are some differences. So I guess they figured,
"Alright, it's close enough we'll just call PowerShell again." And just to be totally clear,
it's not like version 6 and 7 had a non-core version. When they went from version 5 to 6,
they completely changed PowerShell to be on the .NET Core framework,
it's not like they had two parallel versions. So in summary,
PowerShell Core is just an alternative name you can use to refer to versions of PowerShell
that are written on the .NET Core framework, which are at the moment 6 and 7 and also anything going
forward. Now another thing I want to talk about, because you may have also seen this
if you've ever gone to type in PowerShell into the start menu, you may have seen a result
for something called Windows PowerShell ISE come up. And if you open it up,
you can see it as a bunch of these commands on the right hand side and on the left, that's like
this window where you can type in a bunch of text and below it, it looks like a regular PowerShell
window. What is all this about? Well like you might know, and how I discussed in my other video,
PowerShell is not just the name of the command prompt-like program, it's actually also the
name of an entire scripting language. So you could write a program in PowerShell.
So just like you might write a program in Python or some other programming language,
you can write it in PowerShell. And then it runs
in the PowerShell program, but it's also written in the PowerShell language. Anyway,
because you might be writing scripts that are many, many lines long, not just
typing in individual commands. They created the PowerShell ISE integrated scripting environment,
which basically just gives you a larger space where you can type in and create whole script
and also run it as a whole, instead of having to do something silly like
putting each individual line of the script
into PowerShell to test it out and running it individually. You could
just literally run the whole thing at once, also debug the script, it's very similar to
an IDE, integrated development environment for other programs. Though one thing to mention is
the PowerShell ISE is only included with the Windows PowerShell, so installed with Windows.
If you go to download PowerShell Core, latest version of PowerShell,
it's not gonna include a PowerShell Core ISE. It's only the one with Windows that has that.
Why is that? I don't know. So some final thoughts, should you actually install
this latest version of PowerShell they keep telling you to? I mean, yeah, you may as well,
there's not really a reason not to. There are plenty of additional features and like I said,
it's under active development, so there will continue to be new features. For example,
some of the ones listed on the Microsoft article about this. It's cross platform,
we already talked about that. It has improved performance,
there's new Cmdlets which are basically just like little bit more advanced commands,
I talked about that in the other video. And there's new features with the language itself, so
new ways to do different comparisons or whatever. But there are also plenty of
other differences, including ones that may make it not compatible
if you were to try to run certain scripts in older versions of PowerShell. For example,
many commandlets and modules were removed. Also because this is cross platform,
there are some scripts that you might run on Windows that might not work
on another computer. Obviously, if it was like MacOS or Linux. There's
also a whole bunch of other little technical differences that I'm not qualified to explain,
so I'll put that link in the description if you want to see
the exact article that talks about literally all the differences, if you are familiar with that
stuff. But hopefully this video still informed you, maybe you didn't even know about this new
version of PowerShell but now you do, and you decide, "Hey, I wanna get that too."
If you enjoyed the video, be sure to smash the like button so hard that
you literally put your hand through the monitor. And if you wanna keep watching
the next video I'd recommend is that one that I mentioned at the beginning,
talking about the differences between regular Command, Prompt and PowerShell.
I went into quite a bit more differences in general, not just PowerShell Core, so you can
click on that right there. So thanks so much for watching guys, and I'll see you in the next video.