Tuesday, 29 June 2010

PowerShell in Windows 7

In my current project we are using PowerShell in our build & deployment scripts. It's a useful tool offering a greatly extended set of commands comparing to regular cmd. On Windows XP I needed to install this manually but in Windows 7 PowerShell comes with the system.

Recently I changed my machine and system (XP -> W7) and discovered that the scripts don't work anymore. The reason for that was the insufficient execution policy set in PowerShell by default. I changed it to the one previously used on my old machine and... no effect!

I started to think that the problem may not be caused by execution policy (although the error message was quite obvious) but then I found out there are actually 2 PowerShell versions installed: 64 a 32 bit. You can find them under "Windows PowerShell" folder in Accessories:

2 versions of PowerShell in Windows 7

Changing execution policy for both versions solved my problem.

No comments: