Clone wiki

PowerShell Task / Home

PowerShell Task for Bamboo Documentation

A convenient way to use the power of the PowerShell!

1. Overview

Windows PowerShell is a mighty script system and now it can be used for building, deploying and everything else in Atlassian Bamboo®. You can easily create, edit and run scripts directly in Bamboo enjoying syntax highlighting and configuring your scripts with arguments and environment variables. Also scripts benefit from Bamboo variables substitutions.

The plugin is available on the Atlassian Marketplace.

Features

  • Create, edit and run PowerShell scripts
  • Syntax highlighting
  • Bamboo variables substitution
  • Run external PowerShell scripts
  • Pass arguments and environment variables
  • Use Bamboo variables as PowerShell variables
  • See script exit code
  • Control whether to load user profile
  • Choose PowerShell bitness

Compatibility

  • Version 1.1.x => Bamboo 5.x
  • Version 1.0.x => Bamboo 4.2-4.4.8

2. Installation

2.1. Install Using Universal Plugin Manager

The Universal Plugin Manager (UPM) makes it easy to install plugins (add-ons). See the UMP manual:

2.2. Manual Installation

To manually install a plugin into the Bamboo:

  • Copy the plugin (i.e. JAR file) into the <bamboo-home>/plugins/ directory.
  • Restart the Bamboo.

3. PowerShell Task Parameters

Each PowerShell task has the following parameters:

  • Script location
  • Script body or filename
  • Arguments
  • Environment variables
  • Working directory
  • Load the current user profile

Note: each of these parameters can use Bamboo variables substitution.

3.1. Script Location

This switch chooses whether to write a script body directly in Bamboo or use an external file.

3.2. Script Body or Filename

The script body text area works as a text editor and used to write a PowerShell script directly in Bamboo. Also it provides syntax highlighting.

The script filename text field specifies an external PowerShell script. Typically it contains a relative to the working directory path. However absolute paths are also supported. Note that a file must have the .ps1 extension.

3.3. Arguments

This field is used to pass arguments to a script. If an argument contain spaces enclose it in double-quotes. Examples:

  • "my arg1" myarg2

3.4. Environment Variables

There you can specify environment variables for a script. Use the format <name>=<value> and separate name-value pairs with spaces. Examples:

  • myvar1="my value" myvar2=value2

3.5. Working Directory

By default the working directory is a plan directory. However it can be changed to any other relative directory. Examples:

  • bin/release

3.6. Load User Profile

This option changes -NoProfile command line switch. The default value is to use global settings.

The global settings can be changed under Bamboo administration=>Add-ons=>Powershell Task. The default global setting is set to No.

3.7. Bitness

You can choose the bitness of the PowerShell execuatable: Any, x86 or x64. The default is Any.

4. Release Notes

4.1. Version 1.1.x (for Bamboo 5.x)

Version 1.1.12 (12 Mar 2017)

  • New #17: Ability to choose PowerShell bitness

Version 1.1.9 (06 Sep 2015)

  • Improved #16: Ability to configure NoProfile option

Version 1.1.8 (27 Aug 2014)

  • Fixed #15: NoClassDefFoundError exception on some configurations

Version 1.1.7 (30 Jul 2014)

  • Improved #14: Move to the API provided by UPM 2.x.

Version 1.1.6 (14 May 2014)

  • Fixed #13: Non-english characters not working properly

Version 1.1.5 (04 Mar 2014)

  • Fixed #12: Support for spaces in a script path (allow bamboo home to contain spaces)

Version 1.1.4 (15 Dec 2013)

  • Fixed #10: The '<' operator is reserved for future use (caused by too big resulting command line)

Version 1.1.3 (07 Sep 2013)

  • Fixed #7: Script error if bamboo variable name contains colon

Version 1.1.2 (30 Aug 2013)

  • Improved #6: Export Bamboo variables as PowerShell variables so they can be used in external scripts (not only inline)

Version 1.1.1 (26 Aug 2013)

  • Improved #5: Return real exit codes from a script (exit statement support)

Version 1.1 (2 Aug 2013)

  • Improved #4: Add support for deployment projects

4.2. Version 1.0.x (for Bamboo 4.2-4.4.8)

Version 1.0.15 (12 Mar 2017)

  • New #17: Ability to choose PowerShell bitness

Version 1.0.12 (08 Sep 2015)

  • Improved #16: Ability to configure NoProfile option

Version 1.0.11 (27 Aug 2014)

  • Fixed #15: NoClassDefFoundError exception on some configurations

Version 1.0.10 (30 Jul 2014)

  • Improved #14: Move to the API provided by UPM 2.x.

Version 1.0.9 (14 May 2014)

  • Fixed #13: Non-english characters not working properly

Version 1.0.8 (04 Mar 2014)

  • Fixed #12: Support for spaces in a script path (allow bamboo home to contain spaces)

Version 1.0.7 (15 Dec 2013)

  • Fixed #10: The '<' operator is reserved for future use (caused by too big resulting command line)

Version 1.0.6 (07 Sep 2013)

  • Fixed #7: Script error if bamboo variable name contains colon

Version 1.0.5 (30 Aug 2013)

  • Improved #6: Export Bamboo variables as PowerShell variables so they can be used in external scripts (not only inline)

Version 1.0.4 (27 Aug 2013)

  • Improved #5: Return real exit codes from a script (exit statement support)

Version 1.0.3 (20 Jul 2013)

  • Improved #3: Extend plugin compatibility to support Bamboo 4.2-5.0

Version 1.0.2 (18 Jul 2013)

  • Fixed #2: Powershell Task Error in Bamboo 5.0 (Note: If you have previous Bamboo version use Powershell Task 1.0.1)

Version 1.0.1 (23 Jun 2013)

  • Fixed #1: PowerShell Task error on a remote agent

Version 1.0 (4 Jun 2013)

  • Initial public release

5. Support

If you find a bug, have a feature request or have an idea how to improve this plugin please post it at the public bug tracker.

6. Contact

Feel free to contact us via email mailto:support@stellaritysoftware.com and visit our website.

Updated