Variable injection plugin

Oscar Mateu Giner
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 25, 2025

I tried to create a script task to save values to a file, and recover them trhough the variable injection plugin within the same stage, and then read it in the next script task. 
The test is really simple:

 

bamboo_1.jpgbamboo_2.jpgbamboo_3.jpg

 

bamboo_4.jpg

it fails both if I use ${bamboo.inject.version} or $bamboo_inject_version. Actually, any script I put after the plugin always fail, in example, if I just type Write-Host "Hello" it also fails.  

Any idea why? 

1 answer

1 accepted

1 vote
Answer accepted
Oscar Mateu Giner
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 25, 2025

I'm goig to answer myself, I think it was related to the encoding of the file. After saving the properties like this:

$text = "version=1.2.3"
Out-File -FilePath "${bamboo.build.working.directory}\build.txt" -InputObject $text -Append -Encoding ascii

it worked!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events