Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-60140

Cannot run program "powershell" when powershell 6.0 core installed

    Details

    • Similar Issues:

      Description

      Having installed Powershell 6.0 Core on our linux agents, there is no longer a program called "powershell". It is called "pwsh", and as such anything calling "powershell" will fail.

      Example:

      Fails:

      sh('powershell -version')

      Works:

      sh('pwsh -version')

      A workaround is to make a symbolic link between pwsh -> powershell.

      ln -s /usr/bin/pwsh /usr/bin/powershell

        Attachments

          Activity

          jnz_topdanmark Jon Brohauge created issue -
          jnz_topdanmark Jon Brohauge made changes -
          Field Original Value New Value
          Description Having installed Powershell 6.0 Core on our linux agents, there is no longer a program called "powershell". It is called "pwsh", and as such anything calling "powershell" will fail.

          Example:

          Fails:
          {code:java}
          sh('powershell -version'){code}
          Works:
          {code:java}
          sh('pwsh -version'){code}
          A possible (I haven't tried) workaround is to make a symbolic link between pwsh -> powershell.
          Having installed Powershell 6.0 Core on our linux agents, there is no longer a program called "powershell". It is called "pwsh", and as such anything calling "powershell" will fail.

          Example:

          Fails:
          {code:java}
          sh('powershell -version'){code}
          Works:
          {code:java}
          sh('pwsh -version'){code}
          A workaround is to make a symbolic link between pwsh -> powershell.
          {code:java}
          ln -s /usr/bin/pwsh /usr/bin/powershell{code}
          carroll Carroll Chiou made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Not A Defect [ 7 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              jnz_topdanmark Jon Brohauge
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: