PowerShell has been a significant component of the Windows operating system for many years now. Although there are no signs that PowerShell is going away, Microsoft has been promoting a PowerShell alternative called PowerShell Core. That being the case, I wanted to take the opportunity to discuss the differences between PowerShell and PowerShell Core.
As I’m sure you know, PowerShell is included with the Windows operating system and is installed by default. In contrast, PowerShell Core has to be downloaded and installed separately. You can download PowerShell Core from GitHub at this link.
Installing PowerShell Core
Installing PowerShell Core is a simple process. As you can see in the figure below, PowerShell core uses a simple installation wizard that is similar to that of most other Windows applications.
If you look at the next screenshot, you can see what PowerShell core looks like. The version of PowerShell that is included with Windows 10 is running in the window on the left, and PowerShell Core is running in the window on the right.
The most obvious difference between the two windows is the background color, but if you look a little more closely at the two windows you will notice some other details. First, both PowerShell and PowerShell Core include copyright notices indicating that they are Microsoft creations. The PowerShell Core GitHub page almost makes it seem as though PowerShell Core is a third-party tool, but it is officially sanctioned by Microsoft.
Another thing that you will probably notice in the screen capture is the version number. The version of PowerShell that comes with Windows is 5.x. PowerShell Core’s version information does not even describe it as “PowerShell Core,” but rather as PowerShell 6.1.3.
Normally when Microsoft gives us a new version of a Windows component, the new version replaces the old version. However, that is not going to be the case for PowerShell. PowerShell Core is more than just the next version of PowerShell. In fact, it has a somewhat different purpose.
PowerShell Core: Multiplatform — with a caveat
Unlike Windows PowerShell, PowerShell Core is multiplatform. The previously mentioned GitHub site includes download options for Windows, MacOS, and Linux. There are even versions of PowerShell Core that are designed to run on Arm processors.
As nice as it may be to have a multiplatform version of PowerShell, it is important to remember that PowerShell was originally designed to be a management tool for Windows. Some of the Windows-related cmdlets aren’t really applicable to other platforms. For example, Windows PowerShell contains a large set of cmdlets for managing Hyper-V, but Hyper-V does not run on Linux or on MacOS. Hence, Hyper-V related cmdlets probably won’t be included in the Linux or MacOS versions of PowerShell Core.
Even in the Windows version of PowerShell Core, however, there are a lot of cmdlets missing (at least for now). If you want to know just how many cmdlets are missing, then enter the following two commands into both PowerShell and PowerShell Core. These commands count the total number of cmdlets that are available.
$M = Get-Command * | Measure $M.Count
If you look at the screenshot below, you can see that PowerShell currently includes 7,678 cmdlets. On the other hand, PowerShell Core includes only 2,589 cmdlets. Keep in mind that this figure is based on the modules that are currently loaded, but both environments were running the same three modules (Microsoft.PowerShell.Management, Microsoft.PowerShell.Utility, and PSReadLine).
Not only are there a lot of cmdlets missing from PowerShell Core, there are entire modules missing. If you want to know how many modules are missing, you can use a technique similar to the one that I showed you a moment ago to find out. Rather than using the Get-Command cmdlet, we can use the Get-Module cmdlet with the -ListAvailable parameter. Here are what the commands look like:
$M = Get-Module -ListAvailable | Measure $M.Count
If you look at the screenshot below, you can see that while PowerShell 5 currently reports having 136 modules, PowerShell 6 only has 57 modules. In other words, PowerShell 5 has twice as many modules as PowerShell 6 does.
If you are curious as to which modules are missing, you can type Get-Module -ListAvailable. Doing so will cause PowerShell (or PowerShell Core) to display the names of the modules that are currently installed.
So why are so many cmdlets and modules missing from PowerShell Core? Well, as you probably know, Windows PowerShell is based on the .NET Framework. PowerShell Core, on the other hand, is based on the .NET Core Runtime instead. Because the .NET Core Runtime is still relatively new, it is not yet as capable as the .NET Framework. Even so, I have absolutely no doubt that PowerShell Core will eventually include all of the modules and cmdlets that currently exist in PowerShell 5.
PowerShell Core will not replace PowerShell
Earlier I explained that even though PowerShell Core is being treated as PowerShell 6, it does not mean that PowerShell 5 is going away. For right now, Microsoft could not do away with PowerShell 5 even if it wanted to, because as you saw, PowerShell Core is currently far less powerful than PowerShell 5.
Microsoft is going to keep working on PowerShell Core and one day its capabilities will presumably meet or exceed those of Windows PowerShell. Even then, however, Microsoft is not planning on phasing out PowerShell 5.
Going forward, Microsoft’s plan is to only provide bug fixes and security updates to PowerShell 5. The idea is to make PowerShell 5 a very stable and reliable platform that is not going to be significantly modified.
While consistency is going to be the name of the game for PowerShell 5 going forward, the same cannot be said of PowerShell 6. Like PowerShell 5, PowerShell 6 will receive security updates and bug fixes, but it is also going to be getting feature updates over time. Hence, PowerShell 6 will be the command environment of choice for those who want to have the latest and greatest capabilities.