18

I am trying to run a powershell script as part of my Pre-Build on a VS2005 project. I have run

$> powershell Set-ExecutionPolicy UnRestricted 

from a command line before the build and I can run the same script from from the command line. However when the script is run as part of the Pre-Build step it fails with

The execution of scripts is disabled on this system. 
Please see “get-help about_signing” for more details. 

The script works on a co-worker's x32 XP machine, but not on my x64 Windows7 machine.

1 Answer 1

42

Did you set the execution policy in both the 64 and 32 bit Powershell environments? Your 64 bit machine will have both, and each has it's own executionpolicy setting.

Sign up to request clarification or add additional context in comments.

1 Comment

64-bit will run by default on a 64-bit machine. To set it for 32-bit, you need to run C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe (Source: kb.paessler.com/en/topic/…)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.