Make PowerShell default for Windows shell executor

When a user registers a new Shell executor `cmd` is the default shell.
In 11.11 Windows Batch was deprecated
https://about.gitlab.com/2019/05/22/gitlab-11-11-released/#support-for-windows-batch-is-now-deprecated.
For new registered Runners Powershell should be the default shell used
to increase adoption of PowerShell, the user still has the option to go
back to `cmd` if they specify it.

Reference #4163
parent b2a33408
Pipeline #65041121 passed with stages
in 60 minutes and 33 seconds
......@@ -5,6 +5,7 @@ import (
"fmt"
"os"
"os/signal"
"runtime"
"strings"
"github.com/sirupsen/logrus"
......@@ -271,6 +272,11 @@ func (s *RegisterCommand) askExecutorOptions() {
s.askVirtualBox()
s.askSSHLogin()
},
"shell": func() {
if runtime.GOOS == "windows" {
s.Shell = "powershell"
}
},
}
executorFn, ok := executorFns[s.Executor]
......
......@@ -274,6 +274,7 @@ func (b *CmdShell) GenerateScript(buildStage common.BuildStage, info common.Shel
}
func (b *CmdShell) IsDefault() bool {
// TODO: Remove in 13.0 - Make PowerShell default shell for Windows.
return runtime.GOOS == "windows"
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment