Installing PowerShell on Linux

Microsoft's PowerShell product has been open source for a while now, and I'm intrigued by the everything-is-an-object paradigm. I haven't fared well with it at work on Windows machines, but I suspect this is lack of familiarity combined with the very different behaviour brought on by the object-oriented nature of the shell. I'm also a fan of shells in general, so I want to play.

Downloads are available at the Releases page on GitHub. They don't provide releases for either Debian or Fedora, and neither seems to have packages available in the main repositories yet (aptitude search powershell and dnf search powershell respectively come up empty).

The CentOS 7 package seemed fairly obvious for Fedora, so I downloaded it and ran dnf install ./powershell-6.0.0_alpha.18-1.el7.centos.x86_64.rpm. This worked, and all appeared good. But when I attempted to run PowerShell, I got this:

$ powershell
Failed to initialize CoreCLR, HRESULT: 0x80131500

So apparently not such a good match. I don't have a fix for this (I didn't look) so I've uninstalled.

I have another system running Debian 'jessie' (aka 'stable'). Having ensured (per the "How-To Geek" article listed below) that I had 'libunwind' and 'libicu' installed, I tried to install the Ubuntu 16.04 package. This failed as it was demanding 'libicu55' and jessie only has 'libicu52'. But that version matched what the Ubuntu 14.04 package needed, so I downloaded and installed that instead, and ... voila:

$ powershell
PS /home/giles/Desktop>

Not sure if this could be made to work with Debian 'stretch': it looks unlikely, as stretch is using libicu57, and the Ubuntu 16.04 version of powershell was asking for libicu55.

You could of course build from source: I was trying to avoid that, as I haven't had to do it in years and I'd rather not have to install all the "-dev" packages and compilers and edit configurations and then probably find out it didn't build anyway.

Bibliography