I’m attempting to execute Gitlab-Runner on a windows VM. I started the runner on a windows VM under Powershell. I can setup the runner in Gitlab but when I make a change to the repository I get a message that says:
ERROR: Job failed (system failure): prepare environment: failed to start process: exec: “pwsh”: executable file not found in %PATH%. Check Types of shells supported by GitLab Runner | GitLab for more information
The link in the message to more information does not help resolve the issue.
I am expecting the pipeline to report it executed on the windows VM.
I’m stuck and any suggestions would be appreciated.
1 Like
So the solution was to modify the TOML file and change the shell option from PWSH to Powershell. Although the Gitlab register doesn’t allow “shell=powershell” you can edit the TOML file and change it.
2 Likes
I stumbled upon this error as well.
According to this issue: Docs: Powershell core is not installed by default - exec: “pwsh”: executable file not found (#541560), the proper solution is to install “PowerShell Core”.
Explanations for other Windows novices like me: there are two big versions of PowerShell:
-
PowerShell Desktop (Windows PowerShell, version 5.1 and below) is pre-installed on Windows. The executable is powershell.exe
-
PowerShell Core (PowerShell 7+) needs separate installation. The executable is pwsh.exe
So I installed the latest PowerShell version and restarted gitlab-runner, and now my runner can execute jobs.
1 Like