mirror of
https://github.com/actions/runner-images.git
synced 2025-12-20 06:35:47 +00:00
[windows] pin pwsh in toolset (#9072)
This commit is contained in:
@@ -13,8 +13,15 @@ try {
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
|
||||
|
||||
$metadata = Invoke-RestMethod https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/metadata.json
|
||||
$release = $metadata.LTSReleaseTag[0] -replace '^v'
|
||||
$downloadUrl = "https://github.com/PowerShell/PowerShell/releases/download/v${release}/PowerShell-${release}-win-x64.msi"
|
||||
$pwshMajorMinor = (Get-ToolsetContent).pwsh.version
|
||||
|
||||
$releases = $metadata.LTSReleaseTag -replace '^v'
|
||||
foreach ($release in $releases) {
|
||||
if ($release -like "${pwshMajorMinor}*") {
|
||||
$downloadUrl = "https://github.com/PowerShell/PowerShell/releases/download/v${release}/PowerShell-${release}-win-x64.msi"
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
$installerName = Split-Path $downloadUrl -Leaf
|
||||
$externalHash = Get-ChecksumFromUrl -Type "SHA256" `
|
||||
|
||||
Reference in New Issue
Block a user