PowerShell Core is a cross-platform (Windows, Linux, and macOS) automation and configuration tool/framework that works well with your existing tools and is optimized for dealing with structured data (e.g. JSON, CSV, XML, etc.), REST APIs, and object models. It includes a command-line shell, an associated scripting language, and a framework for processing cmdlets.
Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform related PowerShell queries.
In this context, we shall look into how to install PowerShell on Ubuntu 20.04 LTS.
1. Perform System Update
First, make sure that all your system packages are up-to-date by running the following apt commands in the terminal:
$ sudo apt update
$ sudo apt upgrade
2. Install Snap
Run the following command to install Snap on the Ubuntu system:
$ sudo apt install snap
3. Install PowerShell on the system
Install PowerShell using Snap:
$ sudo snap install PowerShell --classic
Once the installation was successful, you can run the PowerShell, by just issuing this command "pwsh" in the prompt:
$ pwsh
PowerShell 6.2.3
Copyright (c) Microsoft Corporation. All rights reserved.
https://aka.ms/pscore6-docs
Type 'help' to get help.
This article covers the process of installing the latest stable version of Microsoft PowerShell on the Ubuntu 20.04 LTS (Focal Fossa) system. In fact, PowerShell is a task-based configuration tool used to automate system administrator tasks.