YorSubs
YorSubs

Reputation: 4090

PowerShell, what Set-ExecutionPolicy is required for right-click "Run with PowerShell"

Sometimes, when I open a script by running from right-click "Run with PowerShell", I get this:

Execution Policy Change
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"):

I would have thought that LocalMachine was enough to provide the rights. I'm also a bit confused that I see it sometimes, but not always.

Get-ExecutionPolicy -list

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

What ExecutionPlicy do I need in place so that right-click "Run with PowerShell" works?

Upvotes: 0

Views: 305

Answers (0)

Related Questions