I have a command in my post-build event command line in Visual Studio 2010
Powershell -command .'$(SolutionDir)Powershell\MoveFiles.ps1'
And when the event runs, I get an error that the command "exited with code 1."
However when I run the same command on the command line (see below), with an actual directory instead of the VS2010 macro, it works perfectly.
Powershell -command .'C:\TFS\MyProject\Main\Source\Powershell\MoveFiles.ps1'
So it seems that the problem lies with how VS2010 is executing the command.
What could be causing this problem?
[UPDATE]
I have also tried changing the post-build event to:
C:\Windows\SysWOW64\WindowsPowerShell\v1.0\Powershell -command .'C:\TFS\MyProject\Main\Source\Powershell\MoveFiles.ps1' and I get the same result as described above. It works when run from the command line but not from VS 2010.