Start Windows PowerShell with the "Run as Administrator" option. Only members of the Administrators group on the computer can change the execution policy.
Enable running unsigned scripts by entering:
set-executionpolicy remotesigned
This will allow running unsigned scripts that you write on your local computer and signed scripts from Internet.
See also Running Scripts at Microsoft TechNet Library.
I found a way to fix this error.
It is as follows:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
Y and press Enter.You need to set a less restrictive execution policy.
Run Set-ExecutionPolicy RemoteSigned
When prompted, choose the answer most appropriate to you.
Execution Policy Change The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose you to the security risks described in the about_Execution_Policies help topic at https:/go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy? [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"):