Short answer to this question is :- No it doesn't work in bamboo.
You try to use bamboo global variable as environment variable inside of a bamboo build environment.
- Get an idea about how to address a global variable in bamboo.link
Define your variable name as key and add this global variable name as value. (add variable in plan configuration), then during the plan you can access that global variable inside whatever script(power shell /shell /bash) you have created.
Don't forget to add the variable name that you defined , inside of the script configuration as environment variable.
- Use this link to define the global variable as plan variable.
link