I'm a relatively recent convert to Windows Powershell, and I seriously love it: power beyond what I understand, it's obvious that this has a future.
The surprise: in 64-bit Windows 7, there are two sets of Powershell settings, one each for x86 and x64.
This came up while building software: I was in "regular" Powershell (which appears to be 64-bit), and had configured the ExecutionPolicy for RemoteSigned; this allows me to run local unsigned .ps1 scripts.
Running the batch build with devenv command (the cmdline mode of Visual Studio), it would consistently fail with a cannot-run-scripts error due to the ExecutionPolicy. It was starting to make me crazy, until my Bingle skills pointed me to a helpful post by fellow MVP Shay Levy (found here).
VS is probably launching the x64 version of PowerShell. x64 machines have two PowerShell shortcuts, launch the x64 console and set the execution policy.
I suspect that's actually backwards—the "native" Powershell appears to be x64, while Visual Studio (a 32-bit application) is likely launching the x86 version—but in any case the fact that there are two sets of knobs fixed my problem exactly.
To change the ExecutionPolicy, one must do right-click + Run As Administrator on each of them (you're running as a limited user, right?) for each of them, and I made it a point to change the console window background to red for both Admin-esque programs (so I can tell when I have the elevated credentials).
I do have a pretty good idea why there are two different executable, but I'm not sure I understand why they have separate sets of knobs: I think this constitutes a surprise.





I can't believe I'm reading this! I spent ALL last night, 11:30pm to 4:00am, unable to set script permissions for my first time using Windows Powershell! It is a wonderful addition to the .NET Framework (well I guess it is, the MS Windows 7 documentation seems to think so).
But I had the same dilemma as you, and could NOT figure out what to do: Which of the four choices should I use with my 64-bit non-prof'l Win7 OS:
Powershell plain,
Powershell x86,
Powershell ISE plain or
Powershell ISE x86?
Seemed like the non-x86 version is correct for 64-bit. But when I tried to run my own simple unsigned script, I could NOT convince Powershell to change my user Execution Policy from Restricted to Remote Signed!
I tried relogging as Admin, rewriting and running the script in Powershell x86, but Win7 chose that moment to hang. Now I really like Win7, but sadly, it abends rather frequently.
But things were bad now: all Aero light from my brand new 18.4" laptop screen with the nVidia 360M graphics card was completely extinguished. Dark. Couldn't invoke Task Manager and no choice other than power off to shut down, twice! Finally got Safe Mode prompts, messed around trying to do diagnostics, nothing would work, so I looked for a recovery point, system hung again. Last straw: restart and I don't even get a VGA 640x480 display with Safe Mode this time. Instead: operating system can not be found. Couldn't even do a screen capture. I was gazing at a white line cursor a thick non-integrated graphics, VT220 style line on a black background. I pulled out the battery, returned 10 hrs later, and now all is well. I'm running with no problem, nor with Powershell.
Thanks so much for your post about the Powershell Surprise. I'll try your approach after dinner.
Posted by: Ellie K | June 16, 2010 at 03:30 PM