Prevent the installation of the same version we have. (#10489)

* Prevent the installation of the same version we have.

* update the buildinfo to be an aka.ms url

* convert tab to spaces

* spaces not tabs
This commit is contained in:
Tyler James Leonhardt
2019-09-12 11:25:30 -07:00
committed by Travis Plunk
parent f69f30ba49
commit 2aae04a659
+12 -1
View File
@@ -244,10 +244,21 @@ try {
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
if ($Daily) {
$metadata = Invoke-RestMethod https://pscoretestdata.blob.core.windows.net/buildinfo/daily.json
$metadata = Invoke-RestMethod 'https://aka.ms/pwsh-buildinfo-daily'
$release = $metadata.ReleaseTag -replace '^v'
$blobName = $metadata.BlobName
# Get version from currently installed PowerShell Daily if available.
$pwshPath = Join-Path $Destination "pwsh"
$currentlyInstalledVersion = if(Test-Path $pwshPath) {
((& $pwshPath -version) -split " ")[1]
}
if($currentlyInstalledVersion -eq $release) {
Write-Verbose "Latest PowerShell Daily already installed." -Verbose
return
}
if ($IsWinEnv) {
if ($UseMSI) {
$packageName = "PowerShell-${release}-win-${architecture}.msi"