0

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?

YorSubs
  • 3,194
  • 7
  • 37
  • 60
  • 1
    Change it to `Unrestricted` or `Bypass` (as long as you're sure). RemoteSigned means it needs to be a signed script. Bear in mind your domain policy might override this anyway – Scepticalist Nov 03 '22 at 10:37
  • Ah yes, I'll do that (not using this in a doman, completely for home use), many thanks. – YorSubs Nov 03 '22 at 12:26

0 Answers0