Quantcast
Channel: Scrum Bug
Viewing all articles
Browse latest Browse all 217

Upgrade Hosted Agent / GitHub Runner PowerShell

$
0
0
Upgrade Hosted Agent / GitHub Runner PowerShell

I managed to upgrade PowerShell at the start of the run and the agent will happily use it after installation.

You need to do two simple things.

  1. Install the PowerShell Core Preview onto the agent.
  2. Make PowerShell Core Preview the default by prepending the PATH environment variable.

Once you know how, it's easy:

- run: |
    Invoke-Expression "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI -preview -quiet"
    "C:\Program Files\PowerShell\7-preview" >> $env:GITHUB_PATH
  name: Upgrade to latest preview of powershell 
  # https://github.com/PowerShell/PowerShell/issues/17404#issuecomment-1188348379

The same trick would work on Azure Pipelines:

- pwsh: | 
    Invoke-Expression "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI -preview -quiet"
    write-host "##vso[task.prependpath]c:\Program Files\PowerShell\7-preview"

Viewing all articles
Browse latest Browse all 217

Trending Articles