Hello Tech World, this is TechThoughts, and
welcome to this special TechThought's video
series focused on learning PowerShell. This is an operationally
designed video series that aims to get you ramped up and using PowerShell quickly. This is
video three in the series, State of the Shell. As always, if you prefer written documentation
the corresponding article for this topic can be found on the techthoughts.info blog, which I've
linked in the description below. Let's go ahead and get started. It can be really beneficial to
have a pulse on the current state of PowerShell. What's going on with PowerShell today? And where is
PowerShell headed tomorrow? Let's cover some quick PowerShell history and then dive into the state
of PowerShell. PowerShell was created by Jeffrey Snover. He's a fantastic guy and if you ever get
an opportunity to go see him speak in person he's a great presenter and is always sharing a
lot of great information. You can also follow him on twitter @jsnover. And back in 2002 he created
PowerShell with the proposal of the Monad Manifesto, which is a really fantastic document. This document
proposed the original design of PowerShell. Now, while this isn't required reading for you
to understand PowerShell, it still remains a really fascinating document that provides a
lot of insight into the early design decisions. So, I highly recommend that you check it out.
In the earlier days PowerShell was released as part of the Windows operating system and as we
progressed through PowerShell 1, PowerShell 2, 3, and 4 these were typically tied to a Windows release.
So Windows XP would get a version, Windows 7 would get a version, Server 2008, Server 2012 all of these
would release with a new version of PowerShell. And these different versions would have
different cmdlets, different functionalities, and various improvements. As each version came
out PowerShell just continued to get better. Again, this was Windows only. You can check out
the techthoughts.info blog which contains additional information about the different versions of
PowerShell. If you're not sure what version of PowerShell that you're currently running either
on your workstation or in your environment you can open up a console window and you can
type in $psversiontable. What I'm doing here is i'm typing in ps ver and I'm using
intellisense and tab to complete that for me. $psversiontable is a reserved variable that gives
you a lot of version information about the current version of PowerShell that you're running. So,
we can see here specifically on the PSEdition that we're running the desktop version
and the PSVersion that we're running is PowerShell 5.1. It also includes a little
bit of build information. You'll notice over here that if i run the same command $psversiontable
that this version is running PowerShell 7. And the PSEdition is Core, which we'll
get to in more detail in just a moment. PowerShell was originally a Windows only
shell and progressed through versions 1 to 5.1 which we see annotated here. Understanding
what version that you're running inside of your environment is very important because the
capabilities that are in 5.1 may be very different than the capabilities that are in PowerShell
version 4 for example or PowerShell version 3. Again, consult the techthoughts.info blog for more
information but as a general rule you can generally consider that a higher version has
additional capabilities, with a few exceptions which we'll get into now. So, the release of
PowerShell version 6 was a huge departure from the 5.1 version. I'm going to cover a couple
of specifics because the release of PowerShell version 6 caused a lot of confusion in the
community, and it's very important that you understand the difference between higher versions
of PowerShell and PowerShell 5.1. The first thing is that PowerShell 6 saw the release of PowerShell
becoming open source. What does that mean? Well, that means that Microsoft has published PowerShell
to GitHub. So you can come on GitHub onto the PowerShell repository and see the entire code
base of PowerShell. Not only that but you can come over to the issues tab and open up bugs
that you think that PowerShell may have, or, see if someone else has already reported a bug that's
going on inside PowerShell, and the PowerShell team will help address this. If you happen to know how
to code in C# you can also contribute to some of these errors and make PowerShell better.
In addition to becoming open source PowerShell also became cross-platform, and we got PowerShell
version 6 on Linux and MacOS. So, you can see here that i am running Ubuntu and we have PowerShell
running inside of this Linux operating system. It really can't be understated how much of a big
deal this is, because now you're empowered to learn one particular shell language which can make
you very effective on multiple operating systems. So, if you know how to check for
processes in Windows using Get-Process, you also know how to check for processes over
in Linux. This is hugely empowering for you and your career. And this makes PowerShell
a very attractive language to learn. Okay but there are a couple of confusing points
between PowerShell version 5.1 and higher versions of PowerShell. So, you would normally think that
as you transition to a higher version number that you get a lot more capabilities. That's not
actually the case between PowerShell version 5.1 and 6, so let me discuss some of the specifics.
With PowerShell 6 the PowerShell team was able to achieve cross-platform by transitioning
to .NET Core. That's the Core that you see here. Notice also that if I type in $psversiontable in
Linux that it is also running Core. But, at the time .NET Core did not have the same level of coverage
as previous PowerShell versions. So PowerShell 6 on release actually had less functionality than
PowerShell 5.1. This wasn't an issue for Linux and MacOS users as they weren't previously able
to engage PowerShell at all. But PowerShell 6 saw very slow adoption in the Windows world because
5.1 provided a better experience in many aspects. .NET Core has come a long way since then and
with the release of PowerShell 7 the PowerShell team has settled into a groove that fully
realizes cross-platform support. Linux and MacOS users you're going to be using
PowerShell 6 or a higher version moving forward. If you're on the Windows side you can have the best of both worlds.
You can run PowerShell 5.1 and higher versions of PowerShell side by side, as you can see I'm running
here. Let's talk about how this is possible. Windows PowerShell uses the powershell.exe
which is located here under system32. PowerShell uses the pwsh.exe found under program
files. Because we're running different executables we can run these different versions of
PowerShell side by side. You may be thinking to yourself well, I'll just stick with 5.1 since
it's included natively with the operating system. But, I'm going to make the case that you go ahead
and transition over to a higher version. 7 has many performance improvements and in many cases you can
accomplish tasks at eight times the speed of 5.1. Additionally, it has many refactored elements
including parallel support, new operators refactored Invoke-WebRequest and Invoke-RestMethod,
better error investigation, and much more. So, let's quickly recap. If you're running on Linux
you're going to be running a PowerShell version higher than 6 full stop. You don't have to worry
about any previous edition of PowerShell. If you're running on Windows you're going to be running
in your environment something like PowerShell 2 to PowerShell 5.1 most likely. Hopefully
5.1 as that has the latest of the available stuff from a Windows perspective. If you're not
sure again run $psversiontable, you'll see that you're most likely running PowerShell 5.1. But
again, you can run both versions side by side. Remember that 5.1 is regulated to security updates
only moving forward. All of the new goodness is going to come in higher versions of PowerShell.
So, what else is going on with PowerShell today? Well, it's available on nearly everything!
We've shown that it's available on Linux, it's available on Windows. But not only is
it cross-platform, it's cross-cloud as well! So whether you're on a
private cloud or public cloud there are PowerShell modules that offer
capabilities across a wide array of platforms. Speaking of modules, the PowerShell Gallery has
nearly 10,000 published modules which can help you solve diverse problems across a broad range
of tech! So, where is PowerShell headed tomorrow? PowerShell is currently being managed by Principal
Software Engineer Steve Lee at Microsoft. I highly recommend that you follow him on twitter for the
latest updates on what's going on with PowerShell. He releases a yearly blog post that lays out
what the PowerShell team will be focused on in the coming year. You can see here that new versions
are on the horizon with an ever increasing set of new capabilities and features. A great way to stay
current with what PowerShell can do is to plug into the PowerShell ecosystem. You can of course
follow Jeffrey Snover and Steve Lee on Twitter. Subscribe to the PowerShell blog which i have
linked here. Stop over to reddit on reddit.com/r/powershell and see what's going on with people
and what they're using PowerShell for today. Also consider joining the PowerShell
conversation on the PowerShell discord. I hope this video has given you some context on
the state of PowerShell. It really is a powerful language that's doing a lot in today's current
technology landscape, and it's really primed to help us continue solving technical problems across
a diverse technical stack in the future. If you'd like to learn more about PowerShell's history
I highly recommend picking up Shell of an Idea by Don Jones. It's a fantastic read that dives into
the complete history of how PowerShell was created. You'll find a link in the description below. Don't
forget that all of this information is available in written format on the techthoughts.info blog.
And, if you found this video helpful go ahead and click that like button and
subscribe for more tech thoughts videos.