Why setting Powershell to set-executionpolicy remotesigned fails?

Using Win7-32bit and Powershell ISE I tried to run a just saved script (let's say containing a simple cls). I got the error, that execution of scripts is forbidden with the usual "get-help about_signing" advice.

When using "set-executionpolicy remotesigned" to solve I got a dialogoue to verify whether I'm sure. But if I accept another error comes up:

acces to registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell" denied + set-executionpolicy <<<< remotesigned + CategoryInfo : NotSpecified: (:) [Set-ExecutionPolicy], UnauthorizedAccessException + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.SetExecutionPolicyCommand

What shall I do, to run saved scripts as user (or automatable as dayly service)?

3 Answers

You need to run powershell as an administrator to set the execution policy.

Once you've set it to remotesigned, you can run powershell as a regular user.

2

Just go to the controll panel -> administrative tools -> Windows PowerShell Modules (opens a powershell) and type the usual set-executionpolicy remotesigned. That's it.

I found the solution by adding the permissions directly to the windows registry.

Wrote about it here: Powershell 101

Hope this helps.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like