The solution is to change the execution policy to one that allows scripts to run.
Learn how to enable Remote Desktop on Windows 10/11 and Windows Server using PowerShell.
Both errors happen when you try to run commands on remote computers using the -ComputerName parameter.