while executing powershell scripts from command prompt you might face this error

“File cannot be loaded because the execution of scripts is disabled on this system”

To fix this

open Your PowerShell command Prompt and issue following command to check the current execution policy


You will see some thing like this Image with


if you see Restricted please use following command

Set-ExecutionPolicy RemoteSigned


Thats is, You are done.

It is strongly recommended not to set the execution policy to RemoteSigned, that can be a security issue. Best to include this in your script start and and end of script set policy back to restricted.