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

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


Get-ExecutionPolicy

You will see some thing like this Image with

Get-ExecutionPolicy

if you see Restricted please use following command


Set-ExecutionPolicy RemoteSigned

Set-ExecutionPolicy

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.