How to fix running scripts is disabled on this system error in PowerShell

Source: https://www.sharepointdiary.com/2014/03/fix-for-powershell-script-cannot-be-loaded-because-running-scripts-is-disabled-on-this-system.html

So you have installed ExchangeOnlineManagement module and try to load it but you got this error.

Cause:

This is due to the Windows PowerShell execution policy being set to prevent untrusted scripts which can affect your Windows client environment. Execution policies are security settings that determine the trust level for scripts run in PowerShell. The default execution policy is “strict” on client operating systems like Windows 10, preventing scripts from running.

Solution:

  1. Open PowerShell Console by selecting “Run as Administrator” and get the execution Policy with the command: Get-ExecutionPolicy to get the current policy applied, such as “Restricted”.
  2. Set the execution Policy with the following command: Set-ExecutionPolicy RemoteSigned
  3. Type “Y” when prompted to proceed.

Leave a comment