Installing PowerShell in Linux

Installing PowerShell in Linux

I do not intend to replicate instructions written well elsewhere, and Microsoft already documented the installation process very well.

I will however share my experience.

I use 2 flavors of Linux: Arch Linux and Ubuntu 20.04 LTS.

My Ubuntu installation start out as Desktop, even if I need it as Sever, this is because the Desktop installer can install the root on ZFS along it's (quite awesome) zsys services (I'll probably ramble about this currently experimental feature in the future).

Arch is where I got my Linux groove back a couple of years ago, and I like it's hands-on approach together with it's awesome AUR community curated package deployment site.

I'll start with Arch. Whenever I can, I install using yay, and if it's an AUR package, whenever possible, I install binary packages. Powershell is no exception.

yay -Sy --no-confirm powershell-bin

Simple.

Ubuntu, supposedly simple, but currently LTS 20.04 isn't supported.

Not currently supported      Ubuntu 20.04  Note  PowerShell can only support the distributions that are supported by .NET. See the .NET Core release notes for a list of supported distributions. If there is a distrbution supported by .NET that is not listed here, you can request that support for the distribution be added. Please file a request using the Distribution Support Request template.
It's actually stated on the documentation page

But the real beauty, with PowerShell now being an open-source project, solutions are shared until official support arrives (which is very soon).

So for now, I'm running pwsh from a local user folder, until the system-wide, apt install based option arrives.

I added an alias to the local pwsh binary, and so invocation in all systems is seamless right now:

alias pwsh='~/.dotnet/tools/pwsh'

next step would be to setup a proper PROFILE to setup the environment as I like.