Hi,
Since the current execution policy is Restricted, no PowerShell script is allowed to run on your machine so you have to run that command in the console. But why not just run
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
Is there any reason to set the scope to Process?
Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Hi,
If you set the scope to Process, only the current PowerShell session is affected. The scope is LocalMachine by default so you don't have to run this command every time you start a new PowerShell session.
Hi Ian,
Thanks again for replying. So you were saying if I used
Set-ExecutionPolicy -ExecutionPolicy Restricted
Then I only need to do this once on my computer, I don't need to set it up anymore in future scripts. Am I correct?
Sorry, you can set it to RemoteSigned or Bypass, not Restricted. I've edited my answer. Yes, you only need to run it once.
Hi Ian,
Thanks a lot! All clear.
Sign in to comment