In this blog post, I will show you how to install PowerShell 7 on Amazon Linux 2 and the latest PowerShell version.
About Amazon Linux 2
Amazon Linux is the next-generation version on Amazon AWS Linux distribution OS that is optimized for running workloads in AWS.
Get Started
To get started, log in to your Amazon Linux 2 and run the following command.
curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo

Next, Install the latest preview release using the line below:
sudo yum install -y powershell-preview

When done, you can run PowerShell 7 using the following command.
Please note that installing the preview edition (7) will not affect the existing version already installed.
pwsh-preview

Processing…
Success! You're on the list.
Whoops! There was an error and we couldn't process your subscription. Please reload the page and try again.