Yes, it seems that Microsoft’s romance with Linux continues and adds up to more “dates” every day. Because recently Microsoft has announced that PowerShell 7 is available for Linux. So let’s take a look at this release.
To start, PowerShell is a powerful console for advanced users like sysadmin or developers. It is available for Windows (obviously), Linux, and macOS. In this new version, it comes loaded with many new features.
First of all, PowerShell is built with Microsoft’s NetCore 3 technology. This allows the application to be faster and more stable, but also more efficient.
On the other hand, in this new version, a problem that affects Linux users is fixed, and that is that in previous versions the execution of the
ls -l command that lists the files in a folder was not reliable because the information of the files was lost.
In the same way, Powershell 7 also incorporates new operators. Among them the ternary operator (?) as well as new pipe chains (|| or &&). In addition, a null operator ( $ null ). As we see these novelties will be better used by advanced users.
Another strong point of this new version is that it increases the backward compatibility with previous versions. Allowing users not to suffer from the changes previously implemented and that can be executed in this version.
PowerShell 7 avilable for many systems
Microsoft has distributed PowerShell 7 for many systems and of course for many Linux distributions. According to the release note, these are the supported ones:
- Red Hat Enterprise Linux (RHEL) / CentOS 7.
- CentOS 8.
- Fedora 30+.
- Debian 9.
- Ubuntu LTS 16.04+.
- Alpine Linux 3.8+
Although you may also be able to implement it in other distributions such as OpenSUSE.
You can download the packages from the project’s Github website.
In the case of Ubuntu, I downloaded the package for the distribution and installed it with gdebi.
:~$ sudo gdebi powershell-lts_7.0.0-1.ubuntu.18.04_amd64.deb Reading package lists... Done Building dependency tree Reading state information... Done Reading state information... Done Requires the installation of the following packages: liblttng-ust-ctl4 liblttng-ust0 liburcu6 PowerShell is an automation and configuration management platform. It consists of a cross-platform command-line shell and associated scripting language. Do you want to install the software package? [y/N]:y Get:1 http://mirrors.advancedhosters.com/ubuntu bionic/main amd64 liburcu6 amd64 0.10.1-1 [52.1 kB] Get:2 http://mirrors.advancedhosters.com/ubuntu bionic/universe amd64 liblttng-ust-ctl4 amd64 2.10.1-1 [80.8 kB] Get:3 http://mirrors.advancedhosters.com/ubuntu bionic/universe amd64 liblttng-ust0 amd64 2.10.1-1 [154 kB] Fetched 287 kB in 0s (0 B/s) Selecting previously unselected package liburcu6:amd64. (Reading database ... 589815 files and directories currently installed.) Preparing to unpack .../liburcu6_0.10.1-1_amd64.deb ... Unpacking liburcu6:amd64 (0.10.1-1) ... Selecting previously unselected package liblttng-ust-ctl4:amd64. Preparing to unpack .../liblttng-ust-ctl4_2.10.1-1_amd64.deb ... Unpacking liblttng-ust-ctl4:amd64 (2.10.1-1) ... Selecting previously unselected package liblttng-ust0:amd64. Preparing to unpack .../liblttng-ust0_2.10.1-1_amd64.deb ... Unpacking liblttng-ust0:amd64 (2.10.1-1) ... Setting up liburcu6:amd64 (0.10.1-1) ... Setting up liblttng-ust-ctl4:amd64 (2.10.1-1) ... Setting up liblttng-ust0:amd64 (2.10.1-1) ... Setting up powershell-lts (7.0.0-1.ubuntu.18.04) ... Processing triggers for libc-bin (2.27-3ubuntu1) ... (Reading database ... 589858 files and directories currently installed.) Preparing to unpack powershell-lts_7.0.0-1.ubuntu.18.04_amd64.deb ... Unpacking powershell-lts (7.0.0-1.ubuntu.18.04) over (7.0.0-1.ubuntu.18.04) ... Setting up powershell-lts (7.0.0-1.ubuntu.18.04) ... Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
And so you can enjoy it.
No doubt this was unthinkable several years ago for Microsoft to make its tools compatible with Linux. This tells us that every day more and more Linux is important.
Please share this post and join our Telegram channel.