diff --git a/tools/install-powershell.ps1 b/tools/install-powershell.ps1 index a09fffd67c..42d56384c0 100644 --- a/tools/install-powershell.ps1 +++ b/tools/install-powershell.ps1 @@ -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"