Microsoft has open sourced PowerShell, it\u2019s automation tool and command line shell. That\u2019s not all, PowerShell is also coming to Linux. The alpha release of PowerShell for Linux is available on the GitHub page; you can test it on Ubuntu, Debian and CentOS. The source of PowerShell is also available on GitHub.\n\n\nSurviving in the multi-cloud world\n\n\nMicrosoft has been kind of behind the UNIX (Linux) world when it comes to feature rich command line interfaces and tools. PowerShell was Microsoft\u2019s answer to those developers who wanted such capabilities. Thanks to its .NET Framework base PowerShell has some great scripting capabilities\u2026.but it doesn\u2019t have everything. It can\u2019t cater to everyone.\n\n\nCustomers live in a multi-OS, multi-platform, multi-cloud world. They use a mix of technologies. And they want flexibility, they want choices of servers, choices of clouds.\n\n\nMicrosoft\u2019s own Azure cloud is witnessing an increase of Linux virtual machines. And Microsoft needs to address the needs of sysadmins, DevOps so that it reduces the complexity of managing Windows and Linux machines from the same client.\n\n\n\u201cIt turns out that's a really hard thing to do, particularly because of the different architectures of the systems,\u201d said Jeffrey Snover, father of PowerShell in an interview with CIO.com. \u201cWhat we're trying to do is have a single-management stack to be able to manage all the workloads for customers, whether they're Windows or Linux, and then allow the customer to be able to manage those on any cloud and from any client that they want. That's really what we're trying to achieve.\u201d\n\n\nSince PowerShell lacked the capabilities to manage Linux machines, Microsoft worked with Canonical to bring Linux bash shell to Windows to enable developers in managing their Linux servers from within Windows 10. And now Microsoft is creating an even playing field by porting PowerShell to Linux. So that developers running Linux can manage their Windows and Linux servers.\n\n\nTo port or not to port\n\n\nWindows and Linux are two different worlds. For example, Windows doesn\u2019t respect case sensitivity, Linux does; Windows uses backward slash for path, Linux uses forward slash. At the same time there are many commands in the Windows world that don\u2019t make sense in Linux. So not everything will be ported to Linux.\n\n\nSnover explained there are many different things that go into deciding what to port and what not to port. There is one core PowerShell that\u2019s been ported to Linux, which includes scripting language, interactive shell and configuration management.\n\n\nThere are other capabilities of PowerShell, such as interacting with AWS and VMware. That\u2019s also ported to Linux.\n\n\nThen there are Windows-specific things like event logging or managing registries that make no sense on Linux. These windows commandlets will not be ported to Linux; they will be open sourced, but not ported.\n\n\nOne shell to rule them all?\n\n\nDoes that mean I can do everything from the Linux terminal or do I need to open a new app? Snover explained that PowerShell is just another shell in the Linux world. You can think of it as a merger between bash and Python. You can change your default shell to PowerShell and call all native Linux capabilities from there including cat, ls, ps...It\u2019s just another shell on Linux.\n\n\nBut what makes it interesting is that it brings the rich object model, rich scripting and language features to Linux. This becomes important when you are dealing with structured data.\n\n\nHistorically, the UNIX\/Linux world has been unstructured data, said Snover. But it\u2019s moving to structured data with use of REST APIs and JSON objects. And that\u2019s where, according to him PowerShell does a much better job.\n\n\nWhy open source it?\n\n\nOpen source breeds confidence in customers. As Mark Shuttleworth, the founder of Canonical once told me, customers don\u2019t want to be at the mercy of single vendor. They want to be able to patch bugs, they want to become an active participant in the development of the very technology they rely on. Open source ensures that.\n\n\n\u201cPeople have not had the benefit to take a look at our source code to see world-class production .NET code, so by open sourcing our code, people are able to just look at our code and learn from it,\u201d Snover said. \u201cIf they ever wonder about how the system is working, or they get an error message which isn't as good as it should been, they're able to go into the source code and see exactly how the system works. It facilitates learning about the system and how it really works.\u201d\n\n\nPowerShell will be developed in the open, and there will be a governance model to dictate how the project will be managed. When I asked who can contribute to it, Snover said that they will soon announce the governance model but anyone \u201ccan make the change themselves and submit that change through a pull request, and if it meets our criteria we'll just bring that into the system and then they'll get their bug fixed.\u201d\n\n\nThat\u2019s the core benefit of open sourcing your technologies, because suddenly your customers become your contributors. \u201cIt benefits us because we get a better, higher-bandwidth conversation with our customers and we also get the benefit of any bug fixes or enhancements that they choose to make,\u201d said Snover.\n\n\nCompete and collaborate\n\n\nMicrosoft is not doing it alone. They have worked closely with Canonical, who gave Microsoft \u201cadvice about how to be a great first-class citizen on the Linux environment,\u201d according to Snover. In addition, Microsoft also worked with Chef, the open source project.\n\n\nTaking care of legal issues\n\n\nEver since the leadership change at Microsoft, the company has been slowly open sourcing components of PowerShell. There are many complexities. There are patent issues, there are copyright issues. \u201cMicrosoft has an incredible investment in PowerShell. We've been working on this for over 15 years and we have a fairly large team. We have well over 30 patents. This is a core strategic technology. Sort of a crown jewel, if you will, of Windows server. Taking that and making it available as open source really required a lot of eyeballs, a lot of gut checks,\u201d Snover said.\n\n\nMicrosoft had to get its legal team involved to make sure everyone understood what was going to be the processes and the criteria to take community code and bring it into and allow it to be shipped as part of Windows. \u201cWe've be doing this for quite a while, making sure all the parts of the company were involved and ready to make this big, big change,\u201d he said.\n\n\nopenSSH is missing\n\n\nOne of the missing pieces of the PowerShell puzzle is support for openSSH. That\u2019s still in the works. You can\u2019t just ssh into your Linux machines from PowerShell. But the team is working with the openSSH community to port it to Windows, both the client and Windows component of openSSH. \u201cWe're taking openSSH and we'll be integrating it into the heart of PowerShell. It will be one of the transports for the PowerShell remoting protocol. Currently it\u2019s layered on top of WinRM but going forward, you'll have the choice of being able to to use WinRM or openSSH. That code is not yet mature enough to release as part of the alpha release, so it's available in a branch and people can play with it. Once it\u2019s in a little better shape it will be part of the main line.\u201d\n\n\nThe balancing act?\n\n\nThere was a segment of Linux users who were complaining about the Microsoft-Canonical partnership that brought the Linux bash shell to Windows. Their concern was that the deal was establishing Windows 10 as a go-to platform for developers, moving them further away from the Linux desktop. With this announcement, Microsoft has balanced it out by providing Linux users with the same capabilities that developers have on Windows 10 through PowerShell. Now developers running Linux machines can easily do the things that they could do on Windows 10.\n\n\nIt also shows that Microsoft is not eating Linux and is in it for the long run. Now Linux is not just a means to an end for Microsoft. The company is building its own core technologies around Linux, so Linux is now as valuable for Microsoft as it is supposedly for Google, Facebook and Amazon.