Recently, I’ve got the above error when trying to execute a powershell script.
Reason: By default, PowerShell’s execution policy is set to Restricted; that means that scripts – including those you write yourself – won’t run.
Solution: Temporarely change the execution policy using the following commands.
- Set-ExecutionPolicy Unrestricted
- Run your powershell script
- Set-ExecutionPolicy Restricted

