I have several team members who can't run powershell scripts via nant. When they do, they get the ExectutionPolicy
(not high enough, still set at the default value). However, they've run Set-ExecutionPolicy RemoteSigned
in a powershell console, and they can run the powershell scripts directly. Any ideas about what's going wrong?
Asked
Active
Viewed 834 times
3

kelloti
- 8,705
- 5
- 46
- 82
-
do ant runs under the same user account ? If you're script is on a remote folder set execution policy to Bypass – Loïc MICHEL Dec 06 '12 at 17:21
-
Nope, everything is local. It also runs fine if run directly. Also, same user is running both. – kelloti Dec 06 '12 at 17:56
1 Answers
4
If they are running on a 64-bit machine, have they set the execution policy for both 32-bit and 64-bit PowerShell? It could be that they set the policy for 64-bit PowerShell and NAnt is firing up 32-bit PowerShell (or vice-versa). Another way to work around this if you're on at least PowerShell 2.0 is to set the policy when invoking PowerShell e.g.:
PowerShell.exe -ExecutionPolicy RemoteSigned ...

Keith Hill
- 194,368
- 42
- 353
- 369