Thursday, December 14, 2006

Running PowerShell in Vista as an Admin

I've documented previously how to get PowerShell to run on Vista. It's a simple hack, but as I've said before, it's unsupported. But it works and I'm using this approach on my laptop, which is now running Vista. I also have a shortcut to PowerShell in  my quick launch window to the right of the Start button.

One thing I discovered is that, like all programs, Vista runs PowerShell sans privileges. Thus when I opened PowerShell to look at the BCDEDIT program, I found BCDEDIT simply gave me the error:

The boot configuration data store could not be opened.
Access is denied

The reason is UAC. Under Vista, PowerShell is running, by default, without admin rights, thus I get the access denied error. Some will argue that this is a good thing, but as the admin,I want to run PowerShell as an admin! But I do appreciate MS looking after me, but I know what I'm doing . UAC is a great feature, but it does not learn. Why should some programmer in Redmond decide what I need to be protected from? I've only been using MS products for 25 years, and in all that time, have never come across the malware Redmond wants to protect me from. But enough of the anti-UAC rant.

The solution to this problem is simple - just adjust the shortcut that starts PowerShell. Right click the shortcut, and select properties. On the Compatibility tab, at the bottom, select "Run this program as an administrator". I'm unclear why MS decided to  put this option on the Compatibility tab but I suppose some Program Manager thought it a good idea.

The only downside is that each time you run PowerShell, you get the dreaded black screen and get asked for permission to run PowerShell as admin. Additionally, although it may be a byproduct of the hack I used to get PowerShell running - Vista can't identify the publisher. It suggests the program is "unidentified" - a feature I hope MS will get fixed when they eventually release PowerShell for Vista.



rajivpopat said...

You can disable UAC if you don't like it - Control Panel\User Accounts

Thomas said...

That is indeed one option. I'd just like more flexibility in what can run unfettered.

tannsi said...

UAC is not a great feature. It utterly sucks and is just a poor hack to solve design defects.