Install PowerShell on Debian/Ubuntu 🌱

What is PowerShell?

PowerShell is a cross-platform task automation solution made up of a command-line shell, a scripting language, and a configuration management framework. PowerShell runs on Windows, Linux, and macOS. -https://docs.microsoft.com/en-us/powershell/scripting/overview
  1. Log into the Linux device
  2. Run the following commands in a terminal window
    # update software repositories
    sudo apt update
    # install available software updates
    sudo apt upgrade -y
    # lookup latest release URL
    regex='"browser_download_url": "(https:\/\/github.com\/PowerShell\/PowerShell\/releases\/download\/[^/]*\/powershell_[^/]*.deb_amd64\.deb)"' && response=$(curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/PowerShell/PowerShell/releases/latest) && [[ $response =~ $regex ]] && downloadURL="${BASH_REMATCH[1]}"
    # download powershell
    wget -O ./powershell.deb $downloadURL
    # install powershell
    sudo dpkg -i ./powershell.deb
    # run powershell
    pwsh

Source: https://docs.microsoft.com/en-us/powershell/scripting/install/install-debian