I just upgraded to Windows 7 and I want to get my Powershell profile up and running.

I load PS and set the execution policy to unrestricted with my 'run as admin' powers, then put my profile in the appropriate place. I reload PS and it errors.

get-execution policy returns restricted.

However, the registry check returns unrestricted.

After a reboot, the situation remains the same.

Checking further, I observe that under Admin mode, I have Unrestricted powers, but as a regular user, I have Restricted powers.

After doing some Powershell work in XP today, I noticed that in XP, Powershell is always in admin mode. Evidently it got turned into usermode on Win7. Aargh!

How do I get my profile script to execute in regular user mode?

link|improve this question

70% accept rate
feedback

4 Answers

I don't have any trouble with this. Here's what I tested on a pretty clean Windows 7 machine:

  • Log in as an administrator
  • Run PowerShell elevated ("as Administrator")
  • Set-ExecutionPolicy RemoteSigned
  • Log in as Guest
  • Run PowerShell
  • Get-ExecutionPolicy

Returns RemoteSigned

link|improve this answer
feedback

I would right click powershell, go to compatibility options, select "Run this program as an administrator"

If using a script, you could use start++'s sudo implementation. There is a way to do it without the tool, but it's simpler just to use the tool, and it adds some other useful tools anyway.

link|improve this answer
Yeah, but I don't want to run it as an administrator. Running as root by default is not how I like to roll. – Paul Nathan Jan 22 '10 at 18:44
feedback

Do you run it from the command line or from the start menu. For me, I only get the "unrestricted" policy if I run powershell from the start menu link.

Starting it from the command line or from another program I could only get the "restricted" policy. Couldn't find any workaround for this issue except for running powershell from the start menu link...

link|improve this answer
feedback

With Windows 7 (Ultimate in case its relevant, can't see how) I have to be in administrator mode to set the policy but once set it applies to my normal user profile (get-executionpolicy returns "Unrestricted"). When you say you move your profile to the "usual place", what exactly do you mean?

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.