Install PowerShell on ArcoLinux

PowerShell is a cross-platform scripting language that runs on Windows, Linux, and macOS.

ArcoLinux is a rolling release Linux distribution based on Arch Linux. Like other Arch-based Linux distributions, ArcoLinux uses pacman for its package manager.

Prerequisites

  • ArcoLinux was installed using the ArcoLinuxL ISO with the easy installation option.
  • The examples shown in this article were performed using Xfce Terminal.
  • ArcoLinux was fully updated using the sudo pacman -Syu command.

Your mileage may vary with other operating systems, versions, distributions, desktop environments, ISO’s, terminals, installation options, package managers, and versions of PowerShell.

Installation

When you search for PowerShell or pwsh using pacman, no results are returned for installing the PowerShell scripting language:

pacman -Ss "pwsh|powershell"

install-pwsh-arcolinux1a.png

Arch Linux also has a community-driven repository called the Arch User Repository (AUR). It’s home to thousands of packages contributed by Arch users. The software in the AUR isn’t tested by Arch’s creators and maintainers but by its users. As their disclaimer mentions:

“AUR packages are user-produced content. Any use of the provided files is at your own risk."

Several versions of PowerShell exist in the AUR. To install PowerShell, you could use the official process for installing a package from the AUR:

git clone https://aur.archlinux.org/powershell-bin.git
cd powershell-bin
makepkg -si

ArcoLinux includes a couple of tools that make this process easier.

  • yay is a pacman wrapper with AUR support that’s written in Go.
  • paru is an AUR helper written in Rust and based on the design of yay.

You can find several PowerShell packages in the AUR using yay or paru. Use the s parameter to perform a search of the AUR:

paru -Ss powershell

install-pwsh-arcolinux3a.png

To return additional information about a specific package use the i parameter for information:

paru -Si powershell-bin

install-pwsh-arcolinux4a.png

For more information use two i parameters:

paru -Sii powershell-bin

install-pwsh-arcolinux5a.png

You use the S parameter to perform the installation:

paru -S powershell-bin

install-pwsh-arcolinux6a.png

You’ve successfully installed PowerShell on ArcoLinux:

pwsh
$PSVersionTable

install-pwsh-arcolinux7a.png

To learn more about the PowerShell scripting language, see my PowerShell 101 book which is free to read on Microsoft Docs.

References