CruiseControl.NET: PowerShell tasks

Sometimes before you start building you need to perform some more additional actions on build server(e.g. clean up some folder or replace config files). The way out is to use PowerShell. You can easily specify tag in CruiseControl.NET project configuration file and add PowerShell task.

<powershell>
<scriptsDirectory>C:\project1\scripts</scriptsDirectory><!--Scrips folder-->
 <script>delLogs.ps1</script>
 <buildArgs>-workingDir C:\project1\working</buildArgs><!-- Project working folder-->
 <executable>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe</executable><!--PowerShell exe file path-->
 <buildTimeoutSeconds>30</buildTimeoutSeconds>
 <description>Deleted previous build test result files</description>
 </powershell>

So using this task you can do lots of after and before tasks.
If you have problems with PowerShell launching on your build machine read the following article: http://technet.microsoft.com/en-us/library/ee176949.aspx

3 thoughts on “CruiseControl.NET: PowerShell tasks

  1. Hi,
    I’ ve never met the problem like that… and currently have no change to test it…
    The easiest way out try to avoid using white spaces…

Leave a comment