From d3a2edcc5f71526531fead20c0c6b0dc0030e38e Mon Sep 17 00:00:00 2001 From: jhoneill Date: Mon, 18 Nov 2019 01:32:14 +0000 Subject: [PATCH] default CI/Install-PowerShell version to stable release --- CI/InstallPowerShell.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CI/InstallPowerShell.ps1 b/CI/InstallPowerShell.ps1 index b4f3cc7..e49b21c 100644 --- a/CI/InstallPowerShell.ps1 +++ b/CI/InstallPowerShell.ps1 @@ -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)