Install PowerShell 7 on a Windows Server 2019 machine with PowerShell 5.1
This script downloads the MSI package for PowerShell 7, installs it silently, and checks for the success of the installation.
Run this script in a PowerShell 5.1 console with appropriate permissions (Run as Administrator) on your Windows Server 2019 machine. After installation, you can start PowerShell 7 separately from PowerShell 5.1.
Keep in mind. PowerShell 7 is a separate installation and does not replace the existing PowerShell 5.1.