Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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)?

share|improve this question
up vote 12 down vote accepted

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.

share|improve this answer
I ran PowerShellISE as admin... – mbx Jul 1 '10 at 14:41
He means that you need to run in an elevated prompt. You can right-click on the PowerShell icon in the task bar or start menu and select "Run as Administrator". – JasonMArcher Aug 11 '10 at 16:57

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

share|improve this answer

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

Wrote about it here: Powershell 101

Hope this helps.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .