The solution is to change the execution policy to one that allows scripts to run.
Both errors happen when you try to run commands on remote computers using the -ComputerName parameter.
There are a couple of different ways to install PowerShell 7. One method is to download the MSI installer. Another way is to install PowerShell using the winget package manager.