Installing PoweShell on Ubuntu with Snap

Update your Ubuntu

apt-get update
syncing the packages index files
sudo -y apt-get upgrade
updating all installed packages to the latest version

Installing PowerShell

sudo snap install powershell --classic
command to install powershell with snapd

Switch to PowerShell with pwsh

pwsh
pwsh is the process name for PowerShell. To start using PowerShell, you must enter to its environment

Check version of PowerShell

$PSVersionTable
Get the version of Powershell

The installation of PowerShell Core is now complete.