Skip to content

Make pwsh the default shell for new registrations

What does this MR do?

Make new Windows Runner registrations default to explicitly adding the pwsh shell to config.toml instead of powershell. The values defined for already-registered runners are respected (i.e. if a Windows Runner does not have a shell defined, it will default to batch).

Why was this MR needed?

We're favoring defaulting to Powershell Core instead of Powershell Desktop going forward.

What's the best way to test this MR?

$ make runner-bin BUILD_PLATFORMS="-osarch 'windows/amd64'"
$ vagrant up && vagrant ssh

Inside the Windows VM:

C:\> powershell
cd $Env:RUNNER_SRC
gitlab-runner register --executor "shell" --url "https://gitlab.com/" --description "pwsh-runner" --locked="false" --access-level="not_protected" --registration-token="<your token>" --non-interactive

The registered runner in config.toml should have shell = "pwsh" instead of shell = "powershell".

What are the relevant issue numbers?

Closes #26419 (closed)

Edited by Pedro Pombeiro

Merge request reports