khanhas / PowershellRM

Invokes Powershell script in Rainmeter
21 stars 2 forks source link

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

Open Drgabi18 opened 11 months ago

Drgabi18 commented 11 months ago

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.