Skip to content

Commit 3b672a3

Browse files
TylerLeonhardtTravisEz13
authored andcommitted
Prevent the installation of the same version we have. (PowerShell#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
1 parent cb53eb6 commit 3b672a3

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tools/install-powershell.ps1

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,21 @@ try {
244244
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
245245

246246
if ($Daily) {
247-
$metadata = Invoke-RestMethod https://pscoretestdata.blob.core.windows.net/buildinfo/daily.json
247+
$metadata = Invoke-RestMethod 'https://aka.ms/pwsh-buildinfo-daily'
248248
$release = $metadata.ReleaseTag -replace '^v'
249249
$blobName = $metadata.BlobName
250250

251+
# Get version from currently installed PowerShell Daily if available.
252+
$pwshPath = Join-Path $Destination "pwsh"
253+
$currentlyInstalledVersion = if(Test-Path $pwshPath) {
254+
((& $pwshPath -version) -split " ")[1]
255+
}
256+
257+
if($currentlyInstalledVersion -eq $release) {
258+
Write-Verbose "Latest PowerShell Daily already installed." -Verbose
259+
return
260+
}
261+
251262
if ($IsWinEnv) {
252263
if ($UseMSI) {
253264
$packageName = "PowerShell-${release}-win-${architecture}.msi"

0 commit comments

Comments
 (0)