Skip to content

Commit

Permalink
Prevent the installation of the same version we have. (PowerShell#10489)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
TylerLeonhardt authored and TravisEz13 committed Sep 12, 2019
1 parent f69f30b commit 2aae04a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tools/install-powershell.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 2aae04a

Please sign in to comment.