Tech News Today
  • News
  • How To
  • Buyer’s Guide
  • Hardware
    • PC Builds
    • Computer Cases
    • Motherboards
    • Peripherals
    • RAM
  • Gaming
  • Software
  • More
    • Mobile
    • Gadgets
    • Laptops
    • Reviews
Facebook Twitter Instagram
Tech News Today
  • News
  • How To
  • Buyer’s Guide
  • Hardware
    • PC Builds
    • Computer Cases
    • Motherboards
    • Peripherals
    • RAM
  • Gaming
  • Software
  • More
    • Mobile
    • Gadgets
    • Laptops
    • Reviews
Tech News Today
Home»Windows»Fix: Cannot Be Loaded Because Running Scripts Is Disabled On This System

Fix: Cannot Be Loaded Because Running Scripts Is Disabled On This System

AbhishekBy AbhishekMay 5, 2022
cannot-be-loaded-because-running-scripts-is-disabled-on-this-system

While trying to run a PowerShell script (.ps1 file), sometimes you can get the cannot be loaded because running scripts is disabled on this system message.

It is not an error but a security feature to prevent you from running any potentially harmful scripts. You can easily fix this issue by changing the execution policy for PowerShell scripts. Entering a single command should be enough.

Table of Contents

  • Cannot Be Loaded Because Running Scripts Is Disabled
  • How to Fix Cannot Be Loaded Error
  • Related Questions
    • Group Policy or Registry level policy configuration, which has more priority?

Cannot Be Loaded Because Running Scripts Is Disabled

The only reason this issue occurs is because of the PowerShell execution policy. It usually happens due to following reasons:

  • You are running an unsigned PowerShell script.
  • Execution policy is set to restrict all PowerShell scripts.

How to Fix Cannot Be Loaded Error

Here’s how you can make it possible to run the PowerShell script:

  1. Open the admin level terminal for Windows PowerShell or the IDE you are currently using.
  2. Enter Get-ExecutionPolicy. It shows the policy for the current PowerShell session. You can also enter Get-ExecutionPolicy -List to list out the policies for all scopes.
    get-execution-policy
  3. Change the execution policy for the scope you want. 
  4. The command you need for this purpose is: Set-ExecutionPolicy -ExecutionPolicy <policy name> -Scope <scope>. See below to know the possible values for the policy name and scope.
  5. In general, we recommend using Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned, as it is more secure. 
    set-execution-policy
  6. If it doesn’t solve the issue, enter:
    Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted

If you have both 64-bit and 32-bit PowerShell, you must enter this command for both terminals. Their locations are:

  • C:\Windows\System32\WindowsPowerShell\v1.0\Powershell.exe
  • C:\Windows\SysWOW64\WindowsPowerShell\v1.0\Powershell.exe
Note: You can also set the RemoteSigned policy for the Current User by checking the option in Settings > Update & Security > For Developers > PowerShell.

Possible values for <policy name>:

  • Restricted: Disallows running scripts.
  • All Signed: Permits running signed scripts only
  • RemoteSigned: Allows running all scripts from the local computer but only signed ones for scripts you download.
  • Unrestricted: Permits running all scripts but warns before running external scripts
  • Default/Undefined: Restricted for clients and RemoteSigned for servers.
  • Bypass: Permits all scripts, and you get no warning.

Possible <scope> values:

  • MachinePolicy: Group-level policy for all users
  • UserPolicy: Group-level policy for the current user
  • Process: Temporary policy for current PowerShell session
  • CurrentUser: Registry policy configuration for the current user
  • LocalMachine: Registry policy configuration for all users

Related Questions

Group Policy or Registry level policy configuration, which has more priority?

Your system applies the Group Policy settings to the registry periodically or during a sign-in. However, the system checks for the relevant configuration in the registry, not in the group policy.

So, group policy has more priority if you reboot your computer after setting the policy. Otherwise, the registry takes precedence.

fix
Abhishek

I'm an electronics engineer, avid writer, and tech-enthusiast specializing in troubleshooting computer-related issues. I enjoy reading both fiction and non-fiction in diverse genres. Apart from that, I also have a habit of trying out most new games but never completing them.

Related Posts

change drive letter windows 10 11

How To Change A Drive Letter On Windows 10 Or 11

June 8, 2022
disable touch screen windows 11

How to Disable the Touchscreen on Windows 11?

June 8, 2022
enable virtualization windows 11

How to Enable Virtualization on Windows 11

June 7, 2022
how-to-open-file-location-on-windows-11-1

How to Open File Location on Windows 11

June 7, 2022
hibernate windows 11

How to Enable Hibernate in Windows 11?

June 7, 2022
powershell vs cmd

PowerShell VS CMD – What’s The Difference

June 7, 2022
Add A Comment

Leave A Reply Cancel Reply

Latest Posts
fighting-games

11 Best Fighting Games on Steam

June 8, 2022
what-is-the-blue-circle-on-my-samsung

What Is the Blue Circle on My Samsung

June 8, 2022
should-i-use-wd-discovery

What Is WD Discovery? Should I Use It?

June 8, 2022
You may also like
how-to-clear-other-storage-on-iphone

How to Clear Other Storage on iPhone?

June 8, 2022
change drive letter windows 10 11

How To Change A Drive Letter On Windows 10 Or 11

June 8, 2022
how to reset imac without password

How to Reset iMac Without Password

June 8, 2022
Recommended
Cookie Clicker Garden Guide

Cookie Clicker Garden Guide to Unlocking Every Seed

September 26, 2021
monitor no signal

Computer Turns On But Monitor Says No Signal (9 Ways To Fix)

October 25, 2021
Facebook Twitter Pinterest
  • Home
  • About Us
  • Privacy Policy
  • Affiliate Disclosure
© 2022 TechNewsToday.

Type above and press Enter to search. Press Esc to cancel.