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:

1pacman -Ss "pwsh|powershell"

install-pwsh-arcolinux1a.jpg

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:

1git clone https://aur.archlinux.org/powershell-bin.git
2cd powershell-bin
3makepkg -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:

1paru -Ss powershell

install-pwsh-arcolinux3a.jpg

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

1paru -Si powershell-bin

install-pwsh-arcolinux4a.jpg

For more information use two i parameters:

1paru -Sii powershell-bin

install-pwsh-arcolinux5a.jpg

You use the S parameter to perform the installation:

1paru -S powershell-bin

install-pwsh-arcolinux6a.jpg

You've successfully installed PowerShell on ArcoLinux:

1pwsh
2$PSVersionTable

install-pwsh-arcolinux7a.jpg

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

References