default CI/Install-PowerShell version to stable release

This commit is contained in:
jhoneill
2019-11-18 01:32:14 +00:00
parent cc5eff1157
commit d3a2edcc5f

View File

@@ -6,11 +6,15 @@
Param
(
# Version to install in the format from the .msi, for example "7.0.0-preview.1"
[Parameter(Mandatory)]
[String]$Version
)
$ErrorActionPreference = 'Stop'
if (-not $Version) {
$Version = (Invoke-RestMethod https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/metadata.json).StableReleaseTag
}
$Version = $Version -replace "^v",""
'[Progress] Downloading PowerShell Core.'
$MsiPath = Join-Path $env:TEMP "PowerShell-$Version-win-x64.msi"
[System.Net.WebClient]::new().DownloadFile("https://github.com/PowerShell/PowerShell/releases/download/v$Version/PowerShell-$Version-win-x64.msi", $MsiPath)