PowerShell has been a significant component of the Windows operating system for many years now. However, Microsoft has been promoting a PowerShell alternative called PowerShell Core. This blog post aims to discuss the differences between PowerShell vs PowerShell Core.
Introduction to Powershell vs Powershell Core
PowerShell is included with the Windows operating system and is installed by default. In contrast, PowerShell Core has to be downloaded and installed separately. 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.
Multiplatform Capability With Limitations
PowerShell Core, unlike its predecessor Windows PowerShell, is a multiplatform tool. You can download it for various platforms like Windows, MacOS, and Linux from the GitHub site. They’ve even designed versions to run on Arm processors.
While it’s great to have a multiplatform version of PowerShell, it’s crucial to remember that PowerShell was initially created as a management tool for Windows. As a result, some cmdlets related to Windows may not be relevant to other platforms. For instance, Windows PowerShell has a comprehensive set of cmdlets for managing Hyper-V. However, since Hyper-V doesn’t run on Linux or MacOS, it’s unlikely that the Hyper-V related cmdlets will be included in the Linux or MacOS versions of PowerShell Core.
Even in the Windows version of PowerShell Core, you’ll notice that many cmdlets are currently missing. If you’re curious about the number of missing cmdlets, you can run a couple of commands in both PowerShell and PowerShell Core to count the total number of available cmdlets.
$M = Get-Command * | Measure
$M.Count
As you can see, PowerShell currently boasts 2603* cmdlets, while PowerShell Core has a more modest count of 2,333 cmdlets. It’s important to note that these numbers are based on the modules that are loaded at the moment, and both environments were running the same three modules: Microsoft.PowerShell.Management, Microsoft.PowerShell.Utility, and PSReadLine.
PowerShell Core doesn’t just have fewer cmdlets; it’s also missing entire modules. If you’re curious about the number of missing modules, you can use a similar method to the one I just showed you. Instead of using the Get-Command cmdlet, we’ll use the Get-Module cmdlet with the –ListAvailable parameter. Here’s what the commands look like:
$M = Get-Module -ListAvailable | Measure
$M.Count
Looking at the screenshot below, you’ll notice that PowerShell 5 currently has 136 modules, while PowerShell 6 only has 57. In other words, PowerShell 5 has over twice as many modules as PowerShell 6.
If you’re wondering which modules are missing, you can type Get-Module -ListAvailable. This will display the names of the installed modules in either PowerShell or PowerShell Core.
So why does PowerShell Core have fewer cmdlets and modules? The reason lies in its foundation. While Windows PowerShell is built on the .NET Framework, PowerShell Core is built on the .NET Core Runtime. Since .NET Core Runtime is relatively new and not as capable as .NET Framework yet, it explains the discrepancy. However, I’m confident that over time, PowerShell Core will catch up and include all the modules and cmdlets currently available in PowerShell 5
Future Development
Microsoft has already made clear that the future of PS development will be squarely aimed at PSC—not the previous PowerShell 5.1 version.
Will PowerShell Core replace PowerShell?
As mentioned before, despite the introduction of PowerShell Core, also known as PowerShell 6, it doesn’t imply the end of PowerShell 5. Microsoft currently has no plans to discontinue PowerShell 5, given that it’s more powerful than PowerShell Core.
Microsoft will continue to enhance PowerShell Core, and it’s expected that its functionalities will eventually match or even surpass those of Windows PowerShell. Yet, there are no plans to phase out PowerShell 5.
In the future, Microsoft intends to limit updates for PowerShell 5 to bug fixes and security enhancements. The goal is to maintain PowerShell 5 as a stable and reliable platform without significant modifications.
While stability is the focus for PowerShell 5, the same can’t be said for PowerShell 6. Along with security updates and bug fixes, PowerShell 6 will also receive feature updates over time. Therefore, for those seeking the most up-to-date features, PowerShell 6 will be the preferred command environment.
Read also: Windows Powershell Keeps Popping-Up
Conclusion
PowerShell now comes in two flavors: PowerShell (5.1) and PowerShell Core (6.0). .NET Framework is the dependency for PowerShell for Windows-only support, while PowerShell Core is based on the new .NET Core runtime.
In conclusion, while both versions have their own strengths and weaknesses, it’s clear that Microsoft is pushing towards making PowerShell Core the future of its scripting and automation platform. As such, it’s a good idea for system administrators and developers to start familiarizing themselves with this new version..
IT Security / Cyber Security Experts.
Technology Enthusiasm.
Love to read, test and write about IT, Cyber Security and Technology.
The Geek coming from the things I love and how I look.