How to Fix Can’t Run PowerShell Script in Windows 11

PowerShell is one of the most powerful tools in Windows 11, allowing you to automate tasks, manage system configurations, and execute custom scripts. But if you’ve ever tried to run a .ps1 file and saw an error like this:

File C:\Users\Admin\Documents\script.ps1 cannot be loaded because running scripts is disabled on this system.

— you’re not alone.

This error is common on Windows 11 and usually appears when PowerShell’s execution policy prevents scripts from running. The good news? It’s easy to fix — and you don’t need to be a developer to do it.

In this guide, we’ll explain why PowerShell scripts don’t run on Windows 11 by default and show you step-by-step how to enable them safely.

Why PowerShell Scripts Don’t Run on Windows 11

Windows blocks PowerShell scripts by default for security reasons. This helps protect users from running potentially harmful scripts, especially those downloaded from the internet.

The restriction is controlled by something called the Execution Policy — a built-in security feature in PowerShell that determines what kind of scripts are allowed to run.

Here are the most common reasons your script might not run:

  • The execution policy is set to Restricted (default setting).
  • You’re trying to run an unsigned script downloaded from the internet.
  • The script file is blocked by Windows security.
  • You’re running PowerShell without administrator privileges.

Let’s go through how to fix each of these issues.

Fix Can’t Run PowerShell Script in Windows 11

Before you begin, ensure that you have administrator access on your Windows 11 PC and the PowerShell script (.ps1) file that you want to run. These are essential prerequisites for executing scripts successfully, especially when system-level permissions are required.

1: Check Your Current PowerShell Execution Policy

First, you need to check what execution policy your system is currently using.

Here’s how:

  1. Press Windows + S, type PowerShell, and click Run as administrator.
  2. Type the following command and press Enter: Get-ExecutionPolicy
  3. You’ll see one of these values:
    • Restricted — No scripts are allowed to run (default)
    • AllSigned — Only signed scripts are allowed
    • RemoteSigned — Local scripts can run; remote ones must be signed
    • Unrestricted — All scripts can run

If you see Restricted, that’s the reason you can’t run any PowerShell script.

2: Change the Execution Policy

Now that you know your current policy, let’s change it to allow script execution.

Option 1: Allow Scripts Temporarily (Safe Option)

This is the best method if you just want to run a single script without changing global settings.

  1. Open PowerShell as Administrator.
  2. Type this command: Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
  3. Press Enter, then type Y when prompted.

This policy only applies to the current PowerShell session — once you close it, PowerShell reverts to the default policy.

Now try running your script again:

.\script.ps1

Option 2: Allow Scripts Permanently for Your User

If you often run PowerShell scripts, you can set the execution policy permanently (just for your user account).

  1. Run PowerShell as Administrator.
  2. Enter: Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
  3. Press Y to confirm.

This allows:

  • Scripts you create locally to run freely.
  • Scripts downloaded from the internet only if they are digitally signed.

Recommended: This option provides a balance between security and flexibility.

Option 3: Allow All Scripts (Advanced Users Only)

If you’re working in a test or development environment and need full access, you can use:

Set-ExecutionPolicy -Scope LocalMachine -ExecutionPolicy Unrestricted

Then press Y to confirm.

Warning: This setting disables most script restrictions — not recommended for regular use on personal or corporate PCs.

3: Unblock the Script File

If the PowerShell execution policy is correct but your script still won’t run, Windows may have blocked the file after download.

To unblock it:

  1. Right-click your .ps1 script file.
  2. Select Properties.
  3. At the bottom of the window, check for this message: Security: This file came from another computer and might be blocked to help protect this computer.
  4. Check the box Unblock and click Apply → OK.

Now try running your script again:

.\script.ps1

4: Run PowerShell as Administrator

Some scripts require elevated privileges to make system changes. If you run PowerShell normally, these scripts may fail to execute.

To run as admin:

  1. Press Windows + S, type PowerShell.
  2. Right-click Windows PowerShell → select Run as administrator.
  3. Confirm the UAC (User Account Control) prompt.

Then execute your script again.

5: Revert to Default Policy (Optional)

After running your script, you can revert PowerShell to its default (restricted) mode for security.

Run:

Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Restricted

This ensures no scripts run accidentally in the future.

Wrapping Up

And that’s it — you’ve successfully fixed the “Can’t run PowerShell script” issue on Windows 11. In most cases, the problem comes down to PowerShell’s execution policy being too restrictive. By switching to RemoteSigned or using the Bypass option temporarily, you can safely run your scripts without compromising system security.

Just remember: only run scripts from trusted sources — PowerShell is powerful enough to make deep system changes.

Once configured properly, you’ll be able to automate workflows, execute tasks, and enjoy the full potential of PowerShell on your Windows 11 machine.

Posted by Arpita

With a background in Computer Science, she is passionate about sharing practical programming tips and tech know-how. From writing clean code to solving everyday tech problems, she breaks down complex topics into approachable guides that help others learn and grow.