ThioJoe / Windows-Super-God-Mode

Creates shortcuts to virtually every special location or action built into Windows
GNU General Public License v3.0
1.39k stars 97 forks source link

Windows 10 Home Error No Scripts Allowed #18

Closed DenDx closed 2 weeks ago

DenDx commented 2 weeks ago

The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose you to the security risks described in the about_Execution_Policies help topic at https:/go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy? [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): Y Set-ExecutionPolicy : Windows PowerShell updated your execution policy successfully, but the setting is overridden by a policy defined at a more specific scope. Due to the override, your shell will retain its current effective execution policy of Restricted. .(File path) Super_God_Mode.ps1 Error ... cannot be loaded because running scripts is disabled on this system. Cmt: Some responses pointed to windows defender. Win 10 Home is different about Group Policy (has no GP editor, for example). Concern is: I don't want running scripts to be forever native to the machine. So how do I revert to that protection of not being able to run scripts. I wrote a simple echo script (count-to-10.bat) which ran under cmd. Copied it to a .ps1, wouldn't run in PowerShell.

ThioJoe commented 2 weeks ago

You probably have a group policy set at the user policy or machine policy level that is overriding it.

You can do this command to see which policies are applied at what levels: Get-ExecutionPolicy -List

Which will output something like this for example:

        Scope ExecutionPolicy
        ----- ---------------
MachinePolicy       AllSigned
   UserPolicy       Undefined
      Process       Undefined
  CurrentUser       Undefined
 LocalMachine       Undefined

I would bet in your case either UserPolicy or MachinePolicy is set to restricted.

I have a video talking about changing the execution policy which you might have watched to set it to restricted in the first place: https://youtu.be/zW69MisrsWk?t=262

The powershell script is signed so you could choose to set it to AllSigned which would only allow signed scripts on the system. You could also temporarily change the policy in group policy editor.