PowerShell blocks scripts by default — here's how to allow them
PowerShell stops you from running script files as a safety measure. When you try to run a .ps1 file (PowerShell's script format), you'll see an error saying "cannot be loaded because running scripts is disabled on this system." This isn't a permanent block — it's a setting you control, and you can change it in about two minutes.
The setting is called an execution policy. It determines what PowerShell will and won't run. There are several levels of restriction, and which one you need depends on what you're trying to do and whether you're the only person using your computer.
Key Takeaways
- PowerShell's execution policy is a safety setting that blocks scripts by default; you change it with a single command.
- The RemoteSigned policy is the most common choice for personal computers — it allows local scripts but blocks downloaded ones unless they're signed.
- You must run PowerShell as administrator to change the execution policy; right-click the PowerShell icon and select "Run as administrator."
- The change applies only to your user account unless you use the -Scope CurrentUser flag, which is the safest approach for a shared computer.
- You can check your current policy at any time by typing Get-ExecutionPolicy and pressing Enter.
Check your current execution policy first
Before you change anything, find out what your current setting is. Open PowerShell (search for "PowerShell" in the Windows Start menu), type the command below, and press Enter:
Get-ExecutionPolicy
PowerShell will display one of several policy names. Restricted means scripts are blocked entirely. AllSigned means only signed scripts run. RemoteSigned means local scripts run but downloaded ones don't. Unrestricted means everything runs with a warning. Write down what you see — you may not need to change it.
Open PowerShell as administrator
To change the execution policy, PowerShell must run with administrator permissions. Right-click the PowerShell icon in your Start menu and select "Run as administrator." A dialog box will ask "Do you want to allow this app to make changes to your device?" — click "Yes."
You'll know you have administrator access when the title bar says "Administrator: Windows PowerShell" or when the prompt shows a greater-than symbol with a colon, like PS C:\Windows\system32>. If you don't see either of these, close the window and try again, making sure you right-clicked and chose "Run as administrator."
Set the execution policy to RemoteSigned
RemoteSigned is the right choice for most personal computers. It allows you to run scripts you write or read from trusted sources on your own machine, but it blocks scripts that came from the internet unless they're digitally signed by a trusted publisher. Type this command and press Enter:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
PowerShell will ask you to confirm: "Do you want to change the execution policy?" Type Y and press Enter. The command will complete silently — no message means it worked.
The -Scope CurrentUser part is important. It means the change applies only to your user account, not to other people who use the computer. If you're the only user, you can leave it out, but including it is safer.
Verify the change worked
Type Get-ExecutionPolicy again and press Enter. You should see RemoteSigned displayed. Now close the administrator PowerShell window and open a regular PowerShell window (you don't need administrator access to run scripts anymore, only to change the policy).
Navigate to the folder where your script is stored. If your script is on your Desktop in a folder called "MyScripts," you would type:
cd Desktop\MyScripts
Then run your script by typing a period, a backslash, and the script name:
.\scriptname.ps1
Replace "scriptname" with the actual name of your file. Press Enter, and the script should run.
Other execution policies and when to use them
Restricted blocks all scripts. You would only use this if you want to go back to the default blocked state.
AllSigned requires every script — even ones you write yourself — to be digitally signed. This is very strict and rarely necessary unless your workplace requires it. Signing scripts requires a certificate, which is a more advanced task.
Unrestricted allows any script to run without checking where it came from. It will warn you about downloaded scripts, but it won't stop them. This is less safe than RemoteSigned and not recommended unless you have a specific reason.
If you need to change back to a different policy later, use the same Set-ExecutionPolicy command with the policy name you want instead of RemoteSigned.
Troubleshooting if the script still won't run
If you set the policy to RemoteSigned and the script still won't run, the script may have been downloaded from the internet and marked as unsafe by Windows. Right-click the script file in File Explorer, select "Properties," and look for a checkbox that says "Unblock" near the bottom. Check that box and click "explore," then try running the script again.
If you get an error that says "cannot be loaded because running scripts is disabled," you may not have saved the policy change. Go back to administrator PowerShell, run Get-ExecutionPolicy to check what the current policy actually is, and run the Set-ExecutionPolicy command again if needed.
If you're on a work computer, your IT department may have set a group policy that overrides your personal setting. Contact them before trying to change the execution policy — they may need to adjust it on their end.
Frequently Asked Questions
Will changing the execution policy make my computer less find?
RemoteSigned is reasonably find for a personal computer. It prevents scripts downloaded from the internet from running unless they're signed, which blocks most malicious scripts. The main risk is scripts you read and intentionally unblock — only do that for scripts from sources you trust.
Do I have to run PowerShell as administrator every time I want to run a script?
No. You only need administrator access to change the execution policy itself. Once it's set to RemoteSigned, you can run scripts from a regular PowerShell window. You only need administrator access again if you want to change the policy to something else.
What does "Scope CurrentUser" mean, and should I use it?
Scope determines who the policy applies to. CurrentUser means only your account; LocalMachine means everyone on the computer. Use CurrentUser if other people share your computer and you don't want to change their settings. Use LocalMachine only if you're the sole user and you want the setting to explore to all accounts.
Can I undo this change if something goes wrong?
Yes. Run Set-ExecutionPolicy -ExecutionPolicy Restricted -Scope CurrentUser as administrator to go back to the default blocked state. Or set it to any other policy name you prefer. There's no harm in changing it back and forth.
Why does PowerShell block scripts in the first place?
Scripts can do anything a person with your permissions can do — delete files, change settings, install software. Blocking them by default prevents you from accidentally running a malicious script you downloaded. The execution policy is one layer of protection, but you should still be cautious about what scripts you run and where they come from.