PowershellRM icon indicating copy to clipboard operation
PowershellRM copied to clipboard

`ScriptFile`s can't be executed because of `LocalMachine` Execution Policy

Open Drgabi18 opened this issue 1 year ago • 0 comments

Just as the title says, while LineN options work because they use the Default execution policy, running a script file errors out. You can see the Scopes and Execution Policies by running Get-ExecutionPolicy -List. The simple fix to this problem is opening PowerShell as admin and typing

Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope LocalMachine

CurrentUser might also play a role into this, but in all my tests I left it as Unrestricted.

Posting all of this here because I couldn't find it anywhere else online.

Drgabi18 avatar Dec 26 '23 21:12 Drgabi18