Try the following:
task CallBatch {
exec {cmd.exe /c "path\to\my\testscript.bat"}
}
There is no need to wrap the cmd.exe call in the PSake exec {} function, but if you do this, the assembly will fail if the package returns nothing but 0.
The task below always allows assembly failure:
task Return1FromCmd {
exec {cmd.exe /c "@exit 1"}
}
source
share