Skip to content

Commit

Permalink
[windows] pin pwsh in toolset (actions#9072)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhailkoliada authored Dec 28, 2023
1 parent e9057a2 commit 34b6b31
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
11 changes: 9 additions & 2 deletions images/windows/scripts/build/Install-PowershellCore.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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" `
Expand Down
3 changes: 3 additions & 0 deletions images/windows/toolsets/toolset-2019.json
Original file line number Diff line number Diff line change
Expand Up @@ -491,5 +491,8 @@
},
"openssl": {
"version": "1.1.1"
},
"pwsh": {
"version": "7.2"
}
}
3 changes: 3 additions & 0 deletions images/windows/toolsets/toolset-2022.json
Original file line number Diff line number Diff line change
Expand Up @@ -431,5 +431,8 @@
},
"openssl": {
"version": "1.1.1"
},
"pwsh": {
"version": "7.2"
}
}

0 comments on commit 34b6b31

Please sign in to comment.