Archives for: April 2008, 10
10/04/08
64 and 32 bit PowerShell execution policies stored separately
Just stumbled upon this due to some confusion about the version of PowerShell I was running on my 64 bit Vista machine. I ran PowerShell from the start menu, using the context menu to bring it up as Administrator. Then I set the execution policy to RemoteSigned:
Set-ExecutionPolicy RemoteSigned
I ran PowerShell as a normal user (through SlickRun - brought up the 32 bit PowerShell without me noticing at first), tried to run a script and it failed. Get-ExecutionPolicy still showed Restricted. Wtf?
Turns out that the execution policies for 32 and 64 bit PowerShells are stored separately. I don't know, I can't figure out any value in this apart from the obvious "let's fuck with their minds" conspiracy idea. Probably something that wasn't really done on purpose, but still pretty important to know.
SlickRun on 64 bit Vista
I was fighting some problems with SlickRun for a while after installing 64 bit Vista on my machine recently. I noticed issues with powershell (SlickRun was always running the 32 bit version of it, even though the path explicitely specified the 64 bit version), and when I wanted to create a command to run SnippingTool, it turned out to be impossible... there are some very weird things going on in 64 bit Windows.
For example, Explorer shows me SnippingTool.exe in c:\windows\system32 (system32? Go figure), while my 32 bit Altap Salamander doesn't show the same file in that location. In SlickRun it was equally impossible to configure my command to use that path, and when I tried to use the path to the start menu .lnk file instead, SlickRun's path completion feature actually showed the .lnk file, but running it was still impossible.
After a little search, I found this forum post here, which describes an option for 64 bit systems. Quoting (I don't trust forum content to be there when I go back later):
Try this:
- Close SlickRun
- Open C:\users\yourname\appdata\roaming\slickrun
- Edit SlickRun.ini
- In the [General] section, add the line:
Wow64Hack=1
I activated this hack and things are better now - the PowerShell command runs the 64 bit version, and the SnippetTool can be run from it's (alleged) c:\windows\system32 location. I still can't use the .lnk file though, since I get a number (five or so) error message about Crypt32.dll when I try.
Upcoming events - VBUG Spring conference and lots of DDDs
There are several events coming up in the next few weeks, where I'm going to be speaking. Hope to meet some of you there!
If you haven't considered coming to any of these events, now is the time to do so - there's lots of stuff going on, and since all of these events happen "off the beaten track", we hope to see some people there who couldn't easily make it to the more "standard" event locations in Reading or Dublin.
Here's where I'm going to be:
VBUG Spring Conference, Birmingham, UK - April 24th
DDD Ireland, Galway - May 3rd
DDD Scotland, Glasgow - May 10th
I believe I'm also going to be at the North East Scotland .NET User Group on May 14th, but they don't have an announcement for the event yet. Hope to confirm that later.
MVP Summit next week
I'm going to be in Seattle next week for Microsoft's annual global MVP Summit. Would love to meet some of you there - if you see me around, please say hi, or contact me if you want to sort something out in advance.
Still an MVP
Granted, I'm a bit late mentioning this, but I still want to do it. Microsoft gave me another MVP award in the C# category on April 1st. I'm honored - thank you very much, Microsoft, and the various people involved.
As usual, I hope to find the time one day to do a bit more blogging than I've done in the last year or so. At least I am finding time to do a lot of speaking at user groups and events. If I haven't been at your group and you would like me to, feel free to contact me!


