ps1 cannot be loaded because the execution of scripts is disabled on this system Powershell Error




There are many cases, when we get an error “ps1 cannot be loaded because the execution of scripts is disabled on this system” while executing any script in Windows Powershell. It is well understood that the execution policy helps to protect you from scripts that you do not trust. Changing the execution policy might expose you to the security risks. But we still want to change it since, we want to run our scripts or commands in powershell at least for current logged in permissible user.



One point to be noted here is an assumption that you are an administrator of your machine. Trust me, it doesn’t matter of being an administrator, powershell is still not allowing you to execute your commands.

Let’s take example of creating SharePoint Framework (SPFx) component, we want few commands to be executed on powershell like:

yo @microsoft/sharepoint


gulp trust-dev-cert


gulp serve

Everytime we provide these commands (e.g. nodejs or npm packages) to Powershell, it throws as below:


How to resolve this problem?



To fix this problem, let’s first check existing execution policy in the machine. Run below command in powershell.

Get-ExecutionPolicy –List


Now we’ll change execution policy for CurrentUser who is administrator of system as well. Run the following command in powershell.

Set-ExecutionPolicy Unrestricted -Scope CurrentUser


You can the changes by running below command.

Get-ExecutionPolicy –List

Lets continue to your work now, create a SharePoint Framework (SPFx) project

Because you are unrestricted now, you can continue to your work as usual. Let’s check if powershell is executing our provided commands or scripts.



yo @microsoft/sharepoint


Yes, it is working now.

Enjoy Coding!

Read More





THREE QUERIES offers easy access to information about SharePoint and associated technologies, project management, agile and scrum methodologies that helps developers, administrators, architects, technical managers, business analysts and end users. It has grown from there. We provide an important knowledge base for those involved in managing, architecture and developing software projects of all kinds. With weekly/daily exclusive updates, we keep you in touch with the latest business, management, technology thinking.

WE ARE CONNECTED ~ Follow us on social media to get regular updates and opinion on what's happening in the world of SharePoint, front-end, back end web technologies and project management. If you like this article, please share it and follow us at Facebook, Twitter, Instagram and LinkedIn

About Satyendra Mishra

Microsoft certified, motivated, energetic and accomplished SharePoint Consultant and Architect with 13+ years of work experience in Management, Architecture, Analytics, Development and Maintenance. He has been fortunate to be a part of over 20+ Web/Mobile/Software SharePoint and .Net projects delivery with various companies across different industry sectors. This has provided him a valuable insight and experience especially in successful implementation of technology solutions. Having very strong System Architecture, Technological, Management & Analytical Skills, Knowledge of Office 365, SharePoint, .Net, JavaScript, React, Angular, Azure, SQL. In 2016, he decided to start sharing the knowledge back to society in the form for content writing and blogging.
View all posts by Satyendra Mishra →

Leave a Reply

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