Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Getting an error when running Powershell inline script

can't seem to run powershell inline script in bamboo.  I keep getting this error after setting up a new bamboo agent:

Failing task since return code of [powershell -ExecutionPolicy bypass -Command D:\bamboo-agent-home\temp\ID-TP-JOB1-47-ScriptBuildTask-7318819736850637125.ps1] was -1 while expected 0

2 answers

1 accepted

0 votes
Answer accepted
Omar Herrera Community Leader Dec 27, 2018

Hi @Hector Magnanao please check the environment variable PATH have the windows  powershell exe 



For test purpose you can add a new task with this inline cmd script

powershell -Command "$PSVersionTable.PSVersion"

This code show the path variables for you agent.


Omar H.



This is already fixed.  Thanks for your suggestion.

Hi Omar,

This error seems to come back again with a new bamboo agent.  I tried that command above but it gives me this error:

Unable to find executable at cmd.exe. Will try to run it anyway.
'powershell' is not recognized as an internal or external command,
operable program or batch file.

For those who are wondering, I also had this issue on a Windows 2016 box, with bamboo agent running as a non-interactive service, using the java wrapper.exe. On that machine, the system %PATH% was not being loaded for a domain user account which was being used to run the service. I got things working by modifying the wrapper.conf (referenced on the command line for the win service) to include the following lines:


These statements should be on two lines. I used a temporary variable due to a bug mentioned in

This may be a hack. I'm not sure what the proper way of injecting the system PATH into a service context is, if any.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bamboo

Bamboo Data Center - Early Access Program

G’day Bamboo customers, The wait is almost over! We are in the final stages of work on the first release of Bamboo Data Center, our self-managed enterprise offering of Bamboo. This Data Center offe...

1,074 views 0 16
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you