-
Suggestion
-
Resolution: Unresolved
-
None
Currently, Windows runner only uses PowerShell version 5 as the path for the executable is hardcoded into the runners' code. It would be nice to be able to specify which version of PowerShell should be used in the setup process.
This can be worked around with the following steps (In this example, we are specifying PowerShell version 7):
- Find the folder with the executable and all the dependencies for the desired shell version. In this case, PS7 is located at
C:\Program Files\PowerShell\7
- Copy the whole folder 7;
- Navigate to the current hardcoded path for PowerShell
C:\Windows\System32\WindowsPowerShell
- Rename the folder v1.0, i.e. v1.0_old
- Paste the folder 7 in this location;
- Rename the new folder to v1.0 and inside the folder, rename the pwsh.exe binary to powershell.exe
- Your next runner will be ran with the new binary using the new version;