PowerShell Script Execution Disabled? Here's How to Fix It Fast

PowerShell Script Execution Disabled? Here's How to Fix It Fast

Photo by Ferenc Almasi on Unsplash

So you've just written a perfectly good PowerShell script, you double-click it, and Windows throws this at you: "cannot be loaded because running scripts is disabled on this system." It's one of those errors that looks scarier than it is — but it trips up even experienced sysadmins who haven't touched a fresh machine in a while. The PowerShell script execution disabled error is Windows protecting you from yourself, basically, and honestly I get it. But when you're trying to get something done, it's annoying as hell.

Here's what's actually happening under the hood.

PowerShell has something called an Execution Policy — it controls what kinds of scripts are allowed to run on the machine. By default, Windows sets this to Restricted, which means no scripts at all. Not even ones you wrote yourself five minutes ago. This is a security feature, not a bug, and it's worth understanding before you just nuke it and move on.

Check What You're Working With First

Before changing anything, run this to see your current policy:

Get-ExecutionPolicy

If it spits back Restricted, that's your problem. But here's the thing though — you should also check at all scope levels, because group policy can be overriding your local setting without you knowing:

Get-ExecutionPolicy -List

This shows you the policy at every scope: MachinePolicy, UserPolicy, Process, CurrentUser, and LocalMachine. I've wasted a good 20 minutes before wondering why my policy change "wasn't sticking" — turns out a domain GPO at the MachinePolicy level was overriding everything I set locally. Classic.

The Quick Fix (and When to Use It)

For most people running scripts on their own machine, setting the policy to RemoteSigned is the right call. It lets you run local scripts freely, but anything downloaded from the internet has to be digitally signed. Good balance of usability and safety.

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

Using -Scope CurrentUser means you're only changing it for your own profile, not system-wide. That's the responsible move, especially on a shared or corporate machine. If you're on your personal dev box and you just want things to work, -Scope LocalMachine applies it for everyone on the system — but you'll need to run PowerShell as Administrator for that one.

To do that: right-click the Start menu, hit Windows PowerShell (Admin) or Terminal (Admin) depending on your Windows version, then run:

Set-ExecutionPolicy RemoteSigned

The Nuclear Option (Use With Caution)

Unrestricted removes basically all restrictions. I've seen people recommend this on forums and it makes me twitch every time. It'll run everything — including scripts from the internet with no signing requirement. If you're in a locked-down lab environment or just messing around locally with no external scripts, fine. But don't set this on a production machine and forget about it.

Set-ExecutionPolicy Unrestricted

There's also Bypass, which is similar but doesn't even show warnings. Used a lot in CI/CD pipelines or automated deployments where you control the environment completely.

Insider Trick #1: Bypass Without Changing Any Policy

Here's something a lot of people don't know — you can run a specific script with execution policy bypassed just for that single session, without touching your system settings at all:

PowerShell -ExecutionPolicy Bypass -File "C:\Scripts\MyScript.ps1"

This is super handy when you're running something once, or when you're on a machine you don't want to modify. I use this constantly when I'm deploying scripts on client machines and don't want to mess with their existing policy setup. It doesn't persist, it doesn't change anything — it just runs the script and goes home.

Insider Trick #2: Unblock a Downloaded Script

Even with RemoteSigned set, you might still get blocked on a script you downloaded. That's because Windows marks downloaded files with a hidden "Zone Identifier" tag — basically a flag that says "this came from the internet, be careful." You can strip that flag off with one command:

Unblock-File -Path "C:\Scripts\MyDownloadedScript.ps1"

After that, the script runs like any local file. Alternatively, you can right-click the .ps1 file in Explorer, go to Properties, and check the "Unblock" checkbox at the bottom of the General tab. Same result, more clicks. Up to you.

Worth noting — this is separate from execution policy. People mix these two up all the time. Execution policy is about what category of scripts can run. The Zone Identifier block is about the origin of a specific file. You sometimes need to deal with both.

What If You're on a Domain and Can't Change Anything?

If your organization's Group Policy is locking down execution policy — which you'd see as a MachinePolicy or UserPolicy entry in that Get-ExecutionPolicy -List output — you genuinely can't override it from PowerShell alone. That's by design. You'd need to either talk to your domain admin or use the Bypass flag trick mentioned above as a workaround, assuming that's not also locked down.

Some orgs lock things down hard for compliance reasons, and that's fair. Don't try to work around security policy on a corporate machine without knowing what you're doing and whether it violates policy. I'm not your IT department, but I've been that IT department, and we noticed.

Quick Reference

Here are the execution policy levels from most to least restrictive, just so you've got them in one place:

  • Restricted — No scripts at all (default)
  • AllSigned — All scripts must be signed by a trusted publisher
  • RemoteSigned — Local scripts run freely, downloaded scripts must be signed
  • Unrestricted — Everything runs, warnings on internet scripts
  • Bypass — Everything runs, no warnings whatsoever

For 95% of situations, RemoteSigned at the CurrentUser scope is the answer. It's what I default to on any new machine I set up. Set it, forget it, move on with your life.

Hope this saves you from staring at that error message for the next half hour — I've definitely been there.

Related: PowerShell Execution Policy Explained (And How to Actually Fix It)

๋Œ“๊ธ€

Zoho IMAP Settings: The Complete Fix When Your Email Stops Syncing

Quick Summary Zoho IMAP breaks more often than it should, and the error messages are genuinely useless. The fix is usually a combination of using the right server address, enabling IMAP inside Zoho Mail's settings, and generating an app-specific password. This guide covers the exact steps for Outlook, iPhone, Thunderbird, and Android so you stop going in circles. Photo by Fotis Fotopoulos on Unsplash So your Zoho Mail stopped syncing. Emails aren't coming in, your phone shows a spinning indicator forever, or Outlook throws some vague authentication error and you have no idea what changed. Sound familiar? I've seen this exact situation probably thirty times across different clients, and every single time the person swears they didn't change anything. And honestly? They usually didn't. Zoho changed something on their end, or an app update reset a setting, or someone enabled two-factor authentication without realizing what that does to third-party mail clients. The...

Zoho Mail IMAP Configuration: Exact Settings That Work First Time

Quick Summary Getting Zoho Mail IMAP to work in Outlook or Thunderbird is not as straightforward as Zoho's docs make it sound. The port numbers, SSL settings, and app password requirements catch almost everyone off guard the first time. Here are the exact settings and steps that actually work, without the back-and-forth with support. Photo by Fotis Fotopoulos on Unsplash Last month I spent almost two hours on a Friday afternoon helping a new employee get Zoho Mail working in Outlook. Two hours. The settings look simple on paper — and honestly, they are — but there are two or three specific things that Zoho just does not make obvious, and if you miss any one of them, you get a generic authentication error that tells you absolutely nothing useful. Sound familiar? The thing is, I've set up Zoho IMAP maybe forty times across different clients and different mail apps. Outlook, Thunderbird, Apple Mail, even some third-party Android clients. And every single time, someone new come...

์ด ๋ธ”๋กœ๊ทธ ๊ฒ€์ƒ‰

Magnesium Glycinate vs Magnesium Citrate: Which One Actually Fixed My Sleep

Quick Summary I spent months trying different magnesium forms after my sleep fell apart, and the difference between glycinate and citrate is way bigger than I expected Glycinate is the gentler, slower option great for sleep and anxiety, while citrate works faster but comes with some digestive surprises nobody warns you about If you're confused about which one to take, this breaks down exactly what each form does and who should actually be using it Photo by Anshu A on Unsplash About two years ago I hit a wall. I was waking up at 3am every single night, my legs felt restless, and I was grinding my teeth so bad my jaw hurt in the morning. My doctor ran some basic labs, everything came back "normal," and I left that appointment feeling completely dismissed. A friend of mine — she's really into functional nutrition — casually mentioned that I might just be magnesium deficient. I kind of rolled my eyes at first. It sounded like one of those wellness buzzwords people throw...
↑