Question about Set-ExecutionPolicy

Is the command set-ExecutionPolicy Unrestricted -Force right command if i want to run scripts not only for the current powershell session but also if I open new powershell/boot computer. So I would not want to type command set-ExecutionPolicy every time i restart computer/open new powershell session.

Execution policies don’t get reset on reboot of a computer. Once set, the policy applies then and there and for ever till you change it.

Just remember that Unrestricted is not the best practice when setting execution policies, there could be a risk of running malicious scripts. Please read about_Execution_Policies from Microsoft’s docs to set the appropriate level. I set all execution policies as RemoteSigned.


If you do need to lift an ExecutionPolicy restriction, you can do it only for a specific user instead of the whole system. The -scope option can be used to affect only the current user.