Cannot be loaded because the execution of scripts is disabled on this system while running PowerShell for SharePoint online site

This PowerShell tutorial, we will discuss how to fix error cannot be loaded because the execution of scripts is disabled on this system which comes in PowerShell SharePoint.

Recently I was trying to connect to SharePoint Online site by using Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll using PowerShell by giving references like below:

  • Add-Type -Path ‘E:\Bijay\Microsoft.SharePoint.Client.dll’
  • Add-Type -Path ‘E:\Bijay\Microsoft.SharePoint.Client.Runtime.dll’

We wrote the script using Windows PowerShell ISE. But it was giving error like: cannot be loaded because the execution of scripts is disabled on this system

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

We were using Windows 10 64-bit laptop. To resolve the issue, Open the PowerShell command prompt in Administrator mode and then run the below command. Once the command runs successfully RESTART the laptop once.

Set-ExecutionPolicy RemoteSigned

After restart the issue resolved for me.

You may like following PowerShell tutorials:

I hope this SharePoint tutorial, we discussed how to fix error cannot be loaded because the execution of scripts is disabled on this system.

  • >