Trying to run a PowerShell script, and do you get the error “Cannot be loaded because running scripts is disabled on this system”? Then we need to change the execution policy in PowerShell. To protect your computer from malicious scripts, the execution policy of PowerShell is set to restricted by default.

This default setting will prevent you from running any PowerShell script on your computer, even scripts that you have written yourself. Luckily we can easily change the policy with a single command in PowerShell.
In this article
In this article, I will explain how you can quickly fix the error running scripts are disabled on this system, what the different policies are and how to change it on all computers with a Group Policy.
Fix Running scripts is disabled on this System
We are going to start with a quick fix. The method below only solves the issue temporarily, so you can run your script and continue. For a more sustainable solution, scroll a bit down to the next chapter.
- Open PowerShell or Windows Terminal
- Enter the command below to run your script
powershell -ExecutionPolicy Bypass -File script.ps1
The method above bypasses the execution policy only temporarily. This works great for a single file, but it requires you to use the command above every time that you want to run the file. A more sustainable solution is to change the execution policy.
Changing the Execution Policy Permanently
When you work a lot with PowerShell scripts then you probably want to change the Execution Policy permanently. But before we look into how to change the policy, let’s first explain its purpose and the different policies that are available.
The execution policy isn’t designed as a security system to restrict users from executing PowerShell scripts. Each user can simply bypass the policy in their current PowerShell session or even copy and paste the content of the script directly into the console. So what is the purpose of the policy then? Well, it’s designed to prevent unintentional execution of PowerShell scripts.
When changing the policy we have five options to choose from:
Execution Policy | Description |
---|---|
Restricted | Default option – Does not allow to run any PowerShell script |
Unrestricted | Can run any script, shows warning for downloaded scripts |
RemoteSigned | Requires a digital signature for downloaded scripts. You can run locally written scripts. You can unblock downloaded scripts to run them without signature |
ByPass | You can run all scripts and no warnings are displayed |
AllSigned | You can only run signed scripts from trusted publishers |
Most people tend to set the policy to unrestricted, which allows you to run any PowerShell script. But a better option is to use the RemoteSigned policy. This way you can run any locally written scripts, but you will have to unblock all downloaded scripts first. The extra handling prevents users from accidentally downloading and running malicious PowerShell scripts on their system.
All users vs Current user
When changing the policy we can also determine the scope of the change. The following scopes are available for the policy:
Scope | Description |
---|---|
CurrentUser | The policy is only set for the currently logged-in user |
LocalMachine | Policy is changed for all users on the machine |
Process | Policy is only changed for the current PowerShell session |
Set Execution Policy for Current user
So the most common scenario is that you want to change the PowerShell Execution policy for the current user. This will solve the error “running scripts is disabled on this system” for the logged-in user. We will set the policy to RemoteSigned, which means that the user still has to perform an extra step for downloaded scripts.
- Open PowerShell
- Enter the command below and press enter
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
- Optional – Verify the setting with the command
Get-ExecutionPolicy

You can now run any locally created PowerShell script without the error running scripts is disabled on this system.
When you try to run a downloaded PowerShell script with the execution policy RemoteSigned, then you get the error that the file cannot be loaded. The PowerShell script is not digitally signed:

To solve this you will first need to unblock the file. To do this we can of course use a PowerShell cmdlet, Unblock-File
. Simply type the cmdlet followed by the filename/path:
Unblock-File -path .\CreateTestFiles.ps1

Set Execution Policy for all Users
We can also change the policy for all users on a computer. To do this, you will need to have elevated permissions (Administrator permission).
- Right-Click on Start or press Windows key + X
- Choose Windows PowerShell (Admin) or Windows Terminal (Admin)
- Type the following command:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine

We can verify the results with the cmdlet Get-ExecutionPolicy -List
which shows the policy for each scope. Good to know is that the CurrentUser policy takes precedence over the LocalMachine policy. So when you set the CurrentUser policy to restricted and LocalMachine to RemoteSigned, then the user still can’t execute any PowerShell script, because the policy set in the CurrentUser scope overrules the LocalMachine policy.
Change the policy only for the Current Sessions
Another option is to change the policy only for the current PowerShell session. This method is useful when you need to run a couple of PowerShell scripts, but don’t want to change the policy permanently. You could use the Bypass option for each script, but it’s thus also possible to set change the scope for only the current PowerShell session. Use the scope Process
for this:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
Set Execution policy PowerShell with GPO
When you need to modify the policy on multiple computers, then it’s a good idea to use a Group Policy for this. Group Policies allow you to change Windows settings on multiple computers that are members of a domain. Another advantage of the policy is that the setting can’t be overwritten on the computer.
- Open the Group Policy Management Editor and create a new policy.
- Expand Computer Configuration
- Navigate to Policies > Administrative Templates > Windows Components > Windows PowerShell
- Open the setting Turn on Script Execution

- Change the setting to Enabled
- Select the Execution Policy Allow local scripts and remote signed scripts. This is the same as RemoteSigned that we set earlier.

We can verify the setting on one of the clients that are a member of the OU where we just applied the setting. First, make sure that the latest policy is applied on the computer using the GPUpdate command. Optionally you can use the RSOP command to verify the policy, or just check if the execution policy is set with the command:
Get-ExecutionPolicy -list# Result Scope ExecutionPolicy ----- ---------------MachinePolicy RemoteSigned UserPolicy RemoteSigned Process Undefined CurrentUser Undefined LocalMachine Undefined
As mentioned, the advantage of the policies is that users can’t change the policy anymore. When you use the cmdlet set-executionpolicy, you will get an error that the policy is changed, but the setting is overridden by a policy defined at a more specific scope:

Wrapping Up
The best way to set the Execution Policy in PowerShell is to use the Group Policy. This way all existing and new machines in your domain can be configured with the correct policy. Of course, you can create a different policy for the IT department.
I hope this article helped you to solve the error “cannot be loaded because running scripts is disabled on this system”, if you have any questions, then just drop a comment below. If you want to learn more about PowerShell, then make sure you read this getting started guide.
0 Shares
FAQs
How do you fix running scripts is disabled on this system PowerShell? ›
- Open the Group Policy Management Editor and create a new policy.
- Expand Computer Configuration.
- Navigate to Policies > Administrative Templates > Windows Components > Windows PowerShell.
- Open the setting Turn on Script Execution.
To allow PowerShell to run scripts, you need to use the Set-ExecutionPolicy -ExecutionPolicy <PolicyName> command. By default, this command applies your chosen policy to the Local machine scope. If you would like to specify a different scope, you must use the parameter -Scope and provide the name of the scope.
How do I fix error running scripts is disabled on this system? ›Solution for “cannot be loaded because running scripts is disabled on this system“: How do you enable running scripts is disabled on this system error? To fix this issue, we have to set the execution policy using the Set-ExecutionPolicy cmdlet, so that the PowerShell script runs on the particular machine.
How do I unblock a PowerShell script? ›- Unblock a file: PS C:\> Unblock-File -Path C:\Users\User01\Documents\Downloads\PowerShellTips.chm. This command unblocks the PowerShellTips. ...
- Unblock multiple files: PS C:\> dir C:\Downloads\*PowerShell* | Unblock-File.
The “Scripts have been disabled” message in Squarespace edit/preview mode means that all custom JavaScript code on your site will not be executed while you are editing or previewing page content.
How do I repair PowerShell? ›- Enable the Windows PowerShell. ...
- Run the Windows PowerShell With Administrative Privileges. ...
- Try Using a Different Microsoft Account. ...
- Get Rid of Suspicious Third-Party Programs. ...
- Try the Built-In Troubleshooters. ...
- Perform a System Scan. ...
- Restore Your Windows Device.
- Open Run Command/Console ( Win + R )
- Type: gpedit.msc (Group Policy Editor)
- Browse to Local Computer Policy -> Computer Configuration -> Administrative Templates -> Windows Components -> Windows Powershell.
- Enable "Turn on Script Execution"
- Set the policy as needed. I set mine to "Allow all scripts".
Select Start > All Programs > Windows PowerShell version > Windows PowerShell. Type Set-ExecutionPolicy RemoteSigned to set the policy to RemoteSigned. Type Set-ExecutionPolicy Unrestricted to set the policy to Unrestricted.
How do I enable PowerShell script in Windows 10? ›- Start Server Manager.
- Click Features and then click Add Features.
- In Select Features, click Windows PowerShell Integrated Scripting Environment (ISE).
Press Windows + X key and select Command Prompt (Admin). Type the command line: net user administrator /active:yes and press Enter. Once created, try reentering the command in PowerShell using the new Administrator account.
How do I run PowerShell as administrator? ›
- Press Win + R on your keyboard. This will open the Run dialog box.
- From here, type in "PowerShell" and press Ctrl + Shift + Enter key combination.
- If a confirmation prompt pops up, click Yes to continue. This will launch PowerShell as an administrator.
- Click the Start button, and then click Run.
- In the Open field, type the full path of the script, and then click OK. You can also type WScript followed by the full name and path of the script you want to run.
- Unblock-File [-Path] <String[]> [-WhatIf] [-Confirm] [<CommonParameters>]
- Unblock-File -LiteralPath <String[]> [-WhatIf] [-Confirm] [<CommonParameters>]
- PS C:\> Unblock-File -Path C:\Users\User01\Documents\Downloads\PowerShellTips.chm.
- PS C:\> dir C:\Downloads\*PowerShell* | Unblock-File.
- Retrieve the existing ACL rules.
- Craft a new FileSystemAccessRule to apply.
- Add the new ACL rule on the existing permission set.
To get NTFS permissions report on the current working directory in PowerShell, use the Get-ACL cmdlet without any parameters. It returns an access control list for the directory. In the above example, the Get-ACL gets permissions on the current working directory, here in C:\Temp.
How do you check if a script is enabled or not? ›To detect if JavaScript is disabled in a web browser, use the <noscript> tag. The HTML <noscript> tag is used to handle the browsers, which do recognize <script> tag but do not support scripting. This tag is used to display an alternate text message.
How do I turn off script errors in Windows 10? ›If you decide to ignore the errors, you can disable script debugging. To do it, select the Disable script debugging (Internet Explorer) checkbox in Internet Options > Advanced > Browsing settings.
Should I disable scripts? ›Should You Disable JavaScript? While JavaScript can be exploited by hackers, you can absolutely remain safe from hackers even without disabling it. You can choose to disable it when you think a website is bloated with JavaScript, giving you an unpleasant experience.
How do I reset PowerShell settings? ›1: Reset PowerShell or Command Prompt to Default Settings
If you know what setting you changed, you can revert by right-clicking on the top of a Powershell or Command Prompt window and click on Properites. Look for the setting you want to change. If you're not sure what was changed, click on Defaults.
In PowerShell, in order to clear the screen you can either type Clear-Host;, its aliases, cls; and clear; or its equivalent [System. Console]::Clear();. Clear-Host is a PowerShell function, which executes a few lines of code and clears the screen buffer.
Can I reinstall Windows PowerShell? ›
PowerShell 7.3 can be installed from the Microsoft Store. You can find the PowerShell release in the Microsoft Store site or in the Store application in Windows. Benefits of the Microsoft Store package: Automatic updates built right into Windows.
How do I get Administrator permission in PowerShell? ›Step 1: Open the Command Prompt, and type the PowerShell as a command, then press Enter key. Step 2: Now, the command prompt will turn to Windows PowerShell. Step 3: Type the command start-process PowerShell -verb runas and press "enter" key. Step 4: It will bring up an elevated Windows PowerShell as an administrator.
What happens when PowerShell is disabled? ›PowerShell runs as a user-mode application, which means it can only do what the user himself can do. If you disable PowerShell, a user can still accomplish the same actions; he will just use another method to accomplish tasks, such as the command prompt, tools, scripts, and so on.
How do I change the permissions for a PowerShell script? ›- Open Start.
- Search for PowerShell, right-click the top-result and click the Run as administrator option.
- Type the following command to allow scripts to run and press Enter: Set-ExecutionPolicy RemoteSigned.
- Type A and press Enter (if applicable).
Action | Keyboard Shortcuts | Use in |
---|---|---|
Copy | CTRL + C | Script Pane, Command Pane, Output Pane |
Cut | CTRL + X | Script Pane, Command Pane |
Expand or Collapse Outlining | CTRL + M | Script Pane |
Find in Script | CTRL + F | Script Pane |
DefinitionId -eq $null) { #activate publishing feature sharepoint online using powershell Write-host -f Yellow "Activating Feature..." Enable-PnPFeature -Scope Web -Identity $FeatureId -Force Write-host -f Green "Feature Activated Successfully!" } Else { Write-host -f Yellow "Feature is already active!" }
How do I enable active scripting in Windows 10? ›Click the Security tab > Custom Level. In the Scripting section, click Enable for Active Scripting. In the dialog box that displays, click Yes.
How do I remove system restrictions? ›Right-click the Start menu and select Settings. Click Accounts on the Settings window. Select the Other Users tab and select Add someone else to this PC. You will now have the option to either add an existing Microsoft Account or a local administrator account.
How do I turn off Windows restrictions? ›- Click "Start | Control Panel | System and Security | Action Center."
- Choose "Change User Account Control Settings" from the left pane. Type the administrator's password, if prompted, and then press "Enter."
- Drag the slider to "Never Notify." Click "OK" and then restart to disable UAC on the PC.
Go to Settings > Accounts > Family & other users. Click on the Manage family settings online or remove an account option. Select the child account for which you want to turn off parental control and make the necessary changes. *Do note this can only be done by an adult account in microsoft family.
How do I enable run as administrator? ›
Steps to start an application as an administrator
Press and hold down the SHIFT key while you right-click the executable file or the icon for the application, and then select Run as. Select The following user. In the User name and Password boxes, type the administrator account and password, and then select OK.
To run scripts via the command prompt, you must first start up the PowerShell executable (powershell.exe), with the PowerShell location of C:\Program Files\WindowsPowerShell\powershell.exe and then pass the script path as a parameter to it.
How do I Run a PowerShell script as administrator without prompt? ›- Press Win Key + R. A a small window will pop up as shown in the screenshot below.
- Type in powershell and press Ctrl+Shift+Enter or press and hold Ctrl+Shift.
- Click OK to make PowerShell run as administrator.
Step 1: Right-click on the file and select Properties. Step 2: In the General tab, check "Unblock" under "Security". Step 3: Click Apply and then Ok.
How do I force a Windows PowerShell service to start? ›To start or stop a service through PowerShell, you can use the Start-Service or the Stop Service cmdlet, followed by the name of the service that you want to start or stop. For instance, you might enter Stop-Service DHCP or Start-Service DHCP.
How do I allow system permissions? ›- In Windows 10, go to Start > Settings > Privacy > File system and make sure Allow apps to access your file system is turned On.
- In Windows 11, go to Start > Settings > Privacy & security > File system and make sure Let apps access your file system is turned On.
What permissions are needed to run PowerShell on a remote machine? A. To run PowerShell on a remote box the credential used must be a local administrator if connecting via the default session configuration. This can be seen by running Get-PSSessionConfiguration (along with Remote Management Users).
How do I enable system permissions? ›Select Start > Settings > Privacy & security. Select an App permission (for example, Location) then choose which apps can access it. The Privacy page won't list apps with permission to use all system resources. You can't use the Privacy settings to control what capabilities these apps can use.
How do I check restrictions in PowerShell? ›To display the execution policies for each scope in the order of precedence, use Get-ExecutionPolicy -List . To see the effective execution policy for your PowerShell session use Get-ExecutionPolicy with no parameters.
How do I bypass access denied in PowerShell? ›- Run Command Prompt and Windows PowerShell as Administrator.
- Open Command Prompt as Administrator.
- Open Windows PowerShell as Administrator.
- Always Run an Elevated Command Prompt and Windows PowerShell Console.
- Disable UAC Prompts for Command Prompt and Windows PowerShell.
Why is PowerShell not executing scripts? ›
This error is caused by the PowerShell Execution Policy. By default, the PowerShell Execution policy is set to Restricted. This means that PowerShell scripts won't run at all. Execution Policies are not designed as a security model, but more to prevent the accidental execution of a PowerShell script.