Drilling into PowerShell Core

PowerShell Text Purple hero
Recently Microsoft finally released the next generation of PowerShell tools as PowerShell 6.0. However, this version, which is also known as PowerShell Core, is a departure from what you might be used to. You may be wondering what it all means and more importantly, what it means to you. I know I have plenty of questions about where this is all going, so let’s spend a few minutes drilling into PowerShell Core.

A Fork in the Road

Up to now, when someone mentioned “PowerShell” we knew what that meant. But now, we need to be more specific. The world of PowerShell is now split. On one hand, it is the PowerShell you’ve always known. This will be referred to as Windows PowerShell as it will only run on Windows platforms. It utilizes the full .NET Framework. One “benefit” from this split is that that Windows PowerShell is complete. Barring security updates, version 5.1 will be the last shipped version of Windows PowerShell. That doesn’t mean it is going away or that you need to stop using it. Only that going forward, Microsoft is putting all of its development efforts into PowerShell Core.
This new version, which is the v6.0 release, is built on top of .NET Core. As the name suggests, it is a subset of the full .NET Framework. However, because Microsoft made .NET Core open source, PowerShell Core is also open source. Is designed to run not only on Windows but a number of Linux distributions, MacOS, and even some Raspberry Pi variants. On Windows, you can even install it side by side with Windows PowerShell, since the engine is completely different.
PowerShell Core on Windows (Image Credit: Jeff Hicks)
The most noticeable change will be that there are no graphical elements. This means no Out-Gridview and no support for WPF or WinForms scripts running in PowerShell Core. You’ll also find that some commands you’ve relied on in the past are gone, especially when we start looking at non-Windows platforms.

For example, on Linux, there are no CIM or WMI cmdlets. Commands that might leverage Win32 APIs probably won’t work either. However, PowerShell remoting got much more interesting with PowerShell Core. It will take a little extra work on your part but you will be able to use PowerShell remoting commands and connect via Wsman or SSH. Although as far as I can tell, using Wsman will only work between Windows systems running PowerShell Core.
PowerShell Remoting using SSH (Image Credit: Jeff Hicks)
Microsoft’s long-term goal is for an IT Pro to manage any platform from any platform using PowerShell. Clearly, we are just setting off on this yellow brick road.

What’s In Your Datacenter?

Microsoft is committed to cross-platform management and solutions. They don’t care what you use. For Microsoft, the financial value is in Azure, which makes perfect sense. What you have to determine is what *your* management needs are. How diverse is your datacenter? Are you primarily running Windows server instances? If your day job is managing Windows servers or applications like Sharepoint, there’s no reason not to continue using Windows PowerShell. Or are you a truly heterogeneous shop? Now you can run PowerShell commands from your Windows 10 desktop to your CentOS web servers.
In any event, you need to continue thinking about “managing at scale”. Don’t manage 1 server at a time. Think about how you can efficiently manage 100 servers at a time. Windows PowerShell and PowerShell Core should continue to meet that need.

“OK, Jeff. What Do You Really Think?”

To provide some context, understand that I’ve been using PowerShell since before it was released. I grew to appreciate having only a single tool to master to manage everything. Microsoft was committed to PowerShell and it was the future. It was going to be the glue that held other things together like Desired State Configuration. I knew what to expect. When Microsoft first announced open source support, I thought that it would be a terrific addition to my PowerShell world. But since then, I’ve come to feel that someone moved the goal line during the middle of the game. I’m sure I am not the only one that feels a little displaced. I am a little distressed that DSC hasn’t advanced as much as I would have liked with Windows PowerShell and that story is completely changing now with PowerShell Core.
But keep in mind, that my needs from PowerShell are probably in the minority, especially when it comes to Microsoft and its customers. I am not currently invested in cloud technologies or open source servers. I’m still an old-fashioned “servers are down the hall” kind of guy. I am the kind of guy that is fighting a losing battle. I realize that and will be ramping up in other areas to avoid early obsolescence.
For another great perspective on PowerShell Core, I recommend you take a few minutes to read thoughts from Don Jones at PowerShell.org.

Your Next Steps

So where does all of this leave you? First off, if you are responsible for Windows servers, install PowerShell 5.1 wherever possible. I’m assuming you are already running a Windows 10 desktop, which will have the latest version of Windows PowerShell. Next, download and install PowerShell Core for Windows 10 from the PowerShell repository on Github. Even if you don’t have an immediate need, you should begin getting comfortable with it. If you are a Linux admin, spin up a test server and install the PowerShell Core from the same Github repository.
If you are in the middle of learning Windows PowerShell, keep going. Even though there are command differences, the language, syntax, and concepts are unchanged in PowerShell Core. If you know Windows PowerShell fundamentals, learning to use PowerShell Core won’t be that much different.

Finally, let me know what you think about PowerShell Core. How do you plan to use it? What are your pain points? I would love to hear success stories. Feel free to leave comments or reach out to me on Twitter.