Skip to content

insovs/EnablePowerShellScript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

43 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Enable PowerShell Scripts

Enable or disable PowerShell script execution on Windows in one click.
Sets Unrestricted mode, disables UAC & Smart App Control, and unblocks all files in the script directory.
A revert option restores Restricted mode at any time. Everything is safe and fully reversible.

Discord


Installation

Right-click Set-PSExecution.bat β†’ Run as administrator

The script will automatically request administrator privileges, then prompt you to choose an action.


Menu

Option Action
1 Enable β€” Unrestricted mode + UAC off + Smart App Control off + Unblock files
2 Revert β€” Restricted mode only

Important

A restart is required after applying changes for them to take full effect.


Without the script

If you prefer doing it manually, open PowerShell as administrator and run:

Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser -Force

Note

If Windows still blocks the script after this, a Group Policy is overriding the setting. Use the .bat instead β€” it bypasses GPO directly via the registry.


What the script does

Action Description
Unrestricted Mode Allows all .ps1 scripts to run regardless of signature or origin
UAC Disabled Removes elevation prompts to allow seamless script automation
Smart App Control Disabled Stops Windows 11 from blocking unrecognized scripts and apps
File Unblocking Removes the Zone.Identifier tag from files downloaded from the internet
Registry Keys Modifies execution policy, PowerShell logging and system restriction entries
β–Ί Unrestricted Mode

By default, Windows blocks all .ps1 scripts from running. Unrestricted mode removes this restriction entirely, allowing any script to execute regardless of its origin or signature. The script applies this at both the user level and machine level, and also overrides any Group Policy that might enforce a stricter setting.

β–Ί UAC (User Account Control)

The UAC prompt appears every time an app tries to make changes to your system. Disabling it prevents these interruptions so scripts can run without requiring manual approval each time.

Disabling UAC reduces a layer of Windows security. Revert to default settings or re-enable it once you no longer need unrestricted access.

UAC prompt
β–Ί Smart App Control

Smart App Control is a Windows 11 feature that blocks apps and scripts it doesn't recognize. Even with Unrestricted mode enabled, SAC can still silently prevent your scripts from running. The script disables it automatically via the registry.

[!CAUTION] Once disabled, Smart App Control cannot be re-enabled without reinstalling Windows.

Smart App Control steps
β–Ί Zone.Identifier

When you download a file from the internet, Windows silently attaches a hidden tag called Zone.Identifier. This marks the file as untrusted and causes Windows to block or warn when you try to run it β€” even with ExecutionPolicy set to Unrestricted. The script removes this tag automatically from all files in its directory.

You can also remove it manually: right-click any file β†’ Properties β†’ check Unblock β†’ OK.

β–Ί Registry Keys
Registry Key What it controls
HKCU\...\ShellIds\Microsoft.PowerShell β†’ ExecutionPolicy Per-user execution policy
HKLM\...\ShellIds\Microsoft.PowerShell β†’ ExecutionPolicy Machine-wide execution policy
HKLM\...\Windows\PowerShell β†’ ExecutionPolicy + EnableScripts Group Policy override
HKLM\...\PowerShell\ModuleLogging Disables module logging
HKLM\...\PowerShell\ScriptBlockLogging Disables script block logging
HKLM\...\PowerShell\Transcription Disables transcription logging
HKLM\...\Policies\System β†’ EnableLUA UAC on / off
HKLM\SYSTEM\...\CI\Policy β†’ VerifiedAndReputablePolicyState Smart App Control on / off

Revert / Reset

Re-run the script and select 2 Revert. This will restore:

  • PowerShell ExecutionPolicy β†’ Restricted
  • All PowerShell logging policies β†’ restored

Note

All changes are limited to registry keys and can be undone at any time. Revert does not touch UAC or Smart App Control. No user files are modified.


Β©insopti β€” guns.lol/inso.vs Β· For personal use only.

About

πŸ”· This help for enable/disable Powershell script by one click. This enables PowerShell script execution in Unrestricted mode, disables UAC to allow scripts to run without interruption, and automatically unblocks all files in the script's directory.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors