How do you add bamboo variable in powershell?

Hello All,

I'm having hard times to figure this out, I have the following powershell script , simple one:

$BambooPath = 'C:\StartFolder'
$RemoteWebPath = 'C:\DestFolder'
Copy-Item -Path $BambooPath -Destination $RemoteWebPath -Recurse

I wan't to replace in $BambooPath the C:\StartFolder with the bamboo.working.directory variable...anyone has an ideea how to do that?

2 answers

This widget could not be displayed.
Timothy Chin Community Champion Nov 08, 2016
For task configuration fields, use the syntax ${bamboo.myvariablename}. For inline scripts, variables are exposed as shell environment variables which can be accessed using the syntax $bamboo_MY_VARIABLE_NAME (Linux/Mac OS X) or %BAMBOO_MY_VARIABLE_NAME% (Windows).

If it were that easy...It's not working. sad

This widget could not be displayed.

One solution we found rather easy is to use the variables as arguments.

In your case you should use 

$BambooPath = $args[0]; 

And enter as argument : ${bamboo.build.working.directory}

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

76 views 1 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you