I am running a PowerShell script from Bamboo using the Script task. The script file is in the repo, so I'm running it using the "File" Script location:
* Interpreter: Windows PowerShell
* Script location: File
* Script file: .\build.ps1
I'm confident the file exists and is running. However, I don't get any of the output from the script. That is, when I run it locally on my machine, I gets detailed output in the terminal. But when I run on Bamboo, I get no output.
How can I get output when running on Bamboo?
In case, it helps, the commands in the PowerShell script are primarily calling other applications using "&"
I have added `Set-PSDebug -Trace 2`. When I run locally, I get output from each line, but when run via Bamboo, I see no output.
I have also added `Write-Host`, and it similarly gives no output.
In case it helps, the only message I do see is
Failing task since return code of [powershell -NonInteractive -ExecutionPolicy bypass -Command .\build.ps1] was -1 while expected 0
I can also add that if I change the name from `build.ps1` to `build1.ps1` (so the script doesn'tt exist), I instead get the message
File [XXXXXXX\build1.ps1] doesn't exist, trying to run [.\build1.ps1] anyway. Unable to find executable at .\build1.ps1. Will try to run it anyway.
I can't remember if I ever got logging working (and don't have access to the system anymore to check), but I do remember why things were failing.
The bamboo user account PATH environment variable had been modified, and so Powershell wasn't on the path.
I suspect this isn't related, but might be worth looking at.
G’day Community! As we gear up to introduce Bamboo Data Center to the world, we wanted to make sure that we shared a bit more about Bamboo, the product. Our team has put together an overview video ...
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