PowerShell Task

Runs a PowerShell script.

Version

Available from version 1.5

Examples

Minimalist example

1<powershell>
2  <script>dosomething.ps</script>
3</powershell>

Full example

 1<powershell>
 2  <script>dosomething.ps</script>
 3  <executable>C:\program Files\PowerShell\PowerShell.exe </executable>
 4  <scriptsDirectory>C:\Scripts </scriptsDirectory>
 5  <buildArgs>-level=1</buildArgs>
 6  <environment>
 7    <variable name="EnvVar1" value="Some data" />
 8  </environment>
 9  <successExitCodes>1,2,3</successExitCodes>
10  <buildTimeoutSeconds>10</buildTimeoutSeconds>
11  <description>Example of how to run a PowerShell script.</description>
12</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 A set of environment variables set for commands that are executed.
Each variable should be specified as
1<variable name="name" value="value" />

.
Environment Variable array No
executable The PowerShell executable. If not set location is read from the registry. String No PowerShell.exe 1.5
priority The priority class of the spawned process. String - one of:
* Normal
* Idle
* High
* RealTime
* BelowNormal
* AboveNormal
No Normal 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 Monday, 26 May 2014 at 7:18:04 AM