Add support for Powershell 6 Core (pwsh.exe)
Gitlab Runner currently only supports Windows batch and Windows PowerShell on Windows platforms. Recently Microsoft introduced PowerShell 6 (Core) which can run indifferently on Linux or Windows: https://docs.microsoft.com/en-us/powershell/scripting/powershell-scripting?view=powershell-6
This new PowerShell doesn't overwrite the pre-installed Powershell (v5.x) on Windows systems, but runs alongside the old version, thus requiring the user to launch Powershell Core with a different command than previously. The new executable is named "pwsh.exe" and can be launched with the "pwsh" command if the PATH environment variable is correctly set to point to Powershell Core's installation path.
Setting the PATH variable using PowerShell :
[Environment]::SetEnvironmentVariable("PATH", "$env:PATH;C:\Program Files\Powershell\6.0.2", [EnvironmentVariableTarget]::Machine)
It could be possible to create a new structure called "shells/pwsh.go" extending the existing shells/powershell.go structure, and overloading a few functions:
GetConfigurationshould use "pwsh" as the command instead of the existing "powershell" command.
GetNameshould return "pwsh" instead of "powershell"
No other code changes would be necessary, but some testing would need to be done on Linux systems as it's a new capability of Powershell Core.