Skip to content

How to Resolve “Running scripts is disabled on this system” PowerShell Error

Running scripts is disabled on this system in Powershell. This error comes when PowerShell execution policy doesn't allow to run scripts

Category
Windows
On this page

PowerShell is a tool built into Windows that helps you automate tasks and control different parts of your computer. However, when you try to run PowerShell scripts, you might see an error message saying, “Running scripts is disabled on this system.” This happens because, by default, PowerShell is set to block scripts for security reasons.

In this article, we will explain how PowerShell handles script permissions and show you how to fix this error so you can run scripts.

Understanding PowerShell Execution Policies

PowerShell uses different settings, called execution policies, to control if scripts can run. There are four main policies:

  • Restricted: This is the default setting and it blocks all scripts from running. You can still use commands in PowerShell, but no scripts.
  • AllSigned: You can run scripts, but only if they are signed by a trusted publisher. Scripts without a signature won’t work.
  • RemoteSigned: You can run scripts created on your computer. If you download a script from the internet, it must be signed by a trusted publisher to run.
  • Unrestricted: All scripts can run, no matter where they come from or if they are signed. This can be risky, so use this setting carefully.

Error:

The error happens when the current PowerShell policy doesn’t allow you to run scripts. I also got the same error when I tried to run a PowerShell script.

PowerShell – Running scripts is disabled on this system
PowerShell Error – Running scripts is disabled on this system

Solution:

To fix the “Running scripts is disabled on this system” error, you need to change the execution policy. Here’s how:

  1. Open PowerShell as an administrator: Click the Start menu, type “PowerShell”, right-click on “Windows PowerShell,” and choose “Run as administrator”.
  2. Check the current policy: To see what policy is set right now, type this command and press Enter:
    
    Get-ExecutionPolicy
    
    
  3. Change the policy: To allow scripts to run, use the `Set-ExecutionPolicy` command. For example, to set the policy to RemoteSigned, type:
    
    Set-ExecutionPolicy RemoteSigned
    
    

    When asked to confirm, type “Y” and press Enter.

  4. Check the new policy: Run `Get-ExecutionPolicy` again to make sure the policy was changed.
  5. Close and reopen PowerShell to apply the changes.
Resolved "Running scripts is disabled on this system" PowerShell Error
Resolved Running scripts is disabled on this system Error in PowerShell

Note: Changing the policy can affect your system’s security. Be careful which policy you choose, and try to use a setting like RemoteSigned for better security while still allowing scripts to run.

Conclusion

In this article, we talked about PowerShell’s execution policies and how to fix the “Running scripts is disabled on this system” error. By changing the policy, you can run scripts on your computer while keeping it safe. Make sure you only run scripts from trusted sources to avoid security risks. Once you fix the error, you can use PowerShell scripts to automate tasks and manage your system more easily.

Rahul

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

19 Comments

  1. Thanks for the tutorial
    I tried to write the command and the response was:
    ‘Set-ExecutionPolicy’ is not recognized as an internal or external command,
    executable program or batch file.

  2. Mine didn’t work. This is the error

    Get-Process : A positional parameter cannot be found that accepts argument ‘Set-ExecutionPolicy’.
    At line:1 char:1
    + PS C:\> Set-ExecutionPolicy RemoteSigned
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidArgument: (:) [Get-Process], ParameterBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.GetProcessCommand

        1. You are using Get-Process ? May we see your full command?

          All you should be entering is:

          Set-ExecutionPolicy RemoteSigned

  3. Hi,RAHUL

    Thank You So Much For PowerShell – Running scripts is disabled on this system. You Explanation is good.

Leave a Reply

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


Back to top