THE TRUTH ABOUT POWERSHELL CORE 6.0

PowerShell Version 6 has now landed! You can read the full rundown of what’s new on Microsoft’s blog, but our PowerShell expert Neil Fraser has summed up the major changes and crucially, how the changes will affect the way you work.

Contrary to what the name implies, PowerShell Core 6.0 it is not an upgrade from 5.1, it is in fact a separate application.  We need to see the full names to appreciate what has happened:

  • Windows PowerShell 5.1
  • PowerShell Core 6.0

The omission of the word ‘Windows’ is at the heart of the change that is upon us; the new version of PowerShell is cross-platform and will run on Windows, Mac and Linux. Since our company deals predominantly with Microsoft software, and clients using Microsoft Dynamics AX, I am still unsure how the cross-platform will be of benefit to us, however we will be keeping an eye out for any interesting opportunities.

While the Windows version of PowerShell will still be supported, all new features will only be developed for PowerShell Core. So, if you want the latest and greatest updates it’s time to start thinking about making the transition.

Another of the big changes is around the creation of new features. The new version is open source which means it could be you that adds the feature you’ve always wanted, or fixes the bug that has you pulling your hair out. While Microsoft will still be the gate keepers, deciding which updates make it into the general releases, open source has thrown the opportunity to create new features open to the PowerShell  community, and it has already seen a massive uptake in the development of 6.0.

As with the release of any new software, there are some notable issues that we want to highlight. Currently PS Core is using Windows PowerShell 3.0 libraries and not all modules have yet been ported across, which means not all scripts written in PS 5.1 will work on Core. Moving forward, later versions of Core will aim to bridge that gap, however until then some of your trusty old scripts may need to be rewritten.

Another major change is the loss of the built-in Windows PowerShell editor (ISE),  which is not supported by Core. I will admit to shedding a silent tear when I heard this announcement, since I love using the ISE. However on the bright side I now have the opportunity to experiment with some of the other editors out there. Microsoft suggest using VS Code, which has inherent integration with GIT source control; I will explore this in more depth since we already use a GIT repository to keep our scripts safe.

Apart from the paradigm shift that comes with Core, there are also some updates to the functionality. The one that really caught my eye was the ability to step-in debug on an ‘Invoke-Command’ running on a remote computer, anyone who has tried debugging a complex script block which causes an error on a remote session will appreciate this one.

Another great improvement when rolling out core to multiple live servers is that Core does not require a server reboot (provided the prerequisites are already installed), this will massively help to keep all servers up to the latest version across the estate.

And finally, an omission that has annoyed me for ages has been addressed: the Get-Service cmdlet now returns the ‘Startup Type’ and ‘Username’ as well as several other pieces of information.

Happy PowerShelling!