How to enable PowerShell Script execution in Windows 10

You might be getting following error when you execute a PowerShell script:

script.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.

In order to be able to execute the script, we need to turn on script execution in a group policy as follows:

  1. Run->gpedit.msc
  2. In the Local Group Policy Editor window, navigate to User Configuration\Administrative Templates\Windows Components\Windows PowerShell
  3. On the right side, double click on Turn On Script Execution
  4. Select Enable option and then in Execution Policy drop-down select suitable option. Allow all scripts could be less secure but is the most convenient option:

5. Press OK

Now try to execute the same script again, it should work.

Thanks!

--

--

Farkhod Dadajanov

Muslim, son, husband, father, brother, friend, engineer, youtuber...