Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-22076

Ability to specify PowerShell version for Windows runners

    XMLWordPrintable

Details

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      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):

      1. 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
      2. Copy the whole folder 7;
      3. Navigate to the current hardcoded path for PowerShell
        C:\Windows\System32\WindowsPowerShell
      4. Rename the folder v1.0, i.e. v1.0_old
      5. Paste the folder 7 in this location;
      6. Rename the new folder to v1.0 and inside the folder, rename the pwsh.exe binary to powershell.exe
      7. Your next runner will be ran with the new binary using the new version;

      Attachments

        Activity

          People

            Unassigned Unassigned
            0298b2749e0b Mateus T
            Votes:
            16 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated: