This page last changed on Dec 03, 2009 by csut017.

PowerShell Task

Runs a PowerShell script.

Version

Available from version 1.5

Examples

Minimalist example
<powershell>
  <script>dosomething.ps</script>
</powershell>
Full example
<powershell>
  <script>dosomething.ps</script>
  <executable>C:\program Files\PowerShell\PowerShell.exe</executable>
  <scriptsDirectory>C:\Scripts</scriptsDirectory>
  <buildArgs>-level=1</buildArgs>
  <environment>
    <variable name="EnvVar1" value="Some data" />
  </environment>
  <successExitCodes>1,2,3</successExitCodes>
  <buildTimeoutSeconds>10</buildTimeoutSeconds>
  <description>Example of how to run a PowerShell script.</description>
</powershell>

Configuration Elements

Element Description Type Required Default Version
buildArgs Any arguments to pass into the script. String No None 1.5
buildTimeoutSeconds The maximum number of seconds the build can take. If the build process takes longer than this period, it will be killed. Specify this value as zero to disable process timeouts. Int32 No 600 1.5
scriptsDirectory The directory that the PowerShell scripts are stored in. String No %Documents%\WindowsPowerShell 1.5
description Description used for the visualisation of the buildstage, if left empty the process name will be shown. String No The task/publisher name. 1.5
dynamicValues The dynamic values to use for the task. Dynamic Values array No None 1.5
environment Any environment variables to pass into the script. Environment Variable array No None 1.5
executable The PowerShell executable. String No PowerShell.exe 1.5
script The PowerShell script to run. String Yes None 1.5
successExitCodes The exit codes that mark the script as being successful. String No 0 1.5
Automatically Generated

Documentation generated on Thursday, 3 Dec 2009 at 9:05:15 AM

Document generated by Confluence on Jan 23, 2011 08:52