Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Using PowerShell in self hosted macOS runners ?

Romain T_ October 12, 2022

Hello

How can I use PowerShell on my self hosted runners on macOS ? I already have all my CI written in PowerShell because there was no way to use bash on Windows.

Apparently I can pass a runtime to the runner.jar, but when I pass windows-powershell on mac, it doesn't find git in the path. Although I added it to my powershell profile.

[2022-10-12 15:43:24,146] Runner version: 1.369
[2022-10-12 15:43:24,161] Runner runtime: windows-powershell
Exception in thread "main" com.atlassian.pipelines.runner.core.exception.PrerequisiteFailedRunnerException: git executable not found in PATH.
[2022-10-12 15:43:25,035] Updating runner state to "OFFLINE".
[2022-10-12 15:43:26,185] Shutdown completed


I can't find any documentation on this, but I hope Atlassian is not expecting their user to write and maintain their CI scripts in both PS and SH scripts surely ?

1 answer

1 accepted

0 votes
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 18, 2022

Hi @Romain T_ and welcome to the community!

MacOS runners can use only bash at the moment. PowerShell has not been tested nor is it supported.

However, you can run a PowerShell script in bash using

pwsh myscript.ps1

where myscript.ps1 is the name of your PowerShell script.

Kind regards,
Theodora

Romain T_ October 19, 2022

Thank you, it's working!

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 21, 2022

That's good to hear and you are very welcome!

Feel free to reach out if you ever need anything else!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events