Geeks With Blogs

News QTP and Stuff

Theo Moore Questions... Morphology? Longevity? Incept dates?

I am a powershell user. I use it in testing apps, mostly to either actually work with IE (automated testing) or to configure environments for testing (this can save tons of time and is very repeatable). Powershell is incredibly handy.


I was nodding my head very excitedly when I heard Windows 7 would ship with it standard on some versions. “Perfect!” thought I.


I got my Windows 7 and installed it at work (I actually paid for this) b/c it seems to me that XP 64 isn't supported very well and Windows 7 should add lots of features while using fewer resources than Vista (I had Vista installed on one of my boxes, but really didn't like it). I fired it up after install and was very excited to see Powershell installed. I started up PS and wrote my first script for grins. Powershell informed me that it couldn't run scripts as the Execution Policy was set to restricted.


First off, it's a small thing, but if the software is installed, I think it should be able to run out of the box. Again, a small thing since it is so easily fixed...or so I thought.


I was logged in as th Admin on the box (as an aside, I've learned that Admin doesn't mean much on a Windows 7 box) and attempted:


Set-ExecutionPolicy Unrestricted


However, I am told I don't have access to change the Execution Policy. WTF??


So, I fired up RegEdit to check the registry key and guess what? It wasn't there!


I thought this was a little strange. Why would the key be missing? I added the key and figured I'd be good for running the Set-ExecutionPolicy cmdlet. However, it didn't work! Still didn't have access. I could edit the registry by hand, but couldn't change the setting in Powershell.


I've since read that in order to make this go in Powershell in Windows 7, you have use Run As Administrator when starting PS so that can edit the registry.


I realize that the idea is to secure Windows and make it “safer” but good grief, it seems like I have to fight it everyday to make it do my job.

Posted on Monday, February 22, 2010 10:13 PM | Back to top

Comments on this post: Windows 7 and Powershell: No access to set Execution Policy

Comments are closed.
Comments have been closed on this topic.
Copyright © Theo Moore | Powered by: