powershellgitlabpipelineexecutorrunner

Gitlab runner configuration on windows


i am trying to use gitlab runner installed on my windows machine . But pipeline execution fails with error: ERROR: Job failed (system failure): prepare environment: failed to start process: exec: "pwsh": executable file not found in %PATH%. Check https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading for more information

I am using "shell" as executor while registering runner. I have also setup path variables correctly.

I have setup path varialbes correctly in system variable


Solution

  • In the root directory of your gitlab runner installation, often c:\gitlab-runner you'll see a config.toml file. You need to change pwsh (powershell core) to powershell (powershell).

    [[runners]]
      executor = "shell"
      shell = "pwsh"
    

    to

    [[runners]]
      executor = "shell"
      shell = "powershell"
    

    See also: