mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
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:
committed by
Travis Plunk
parent
f69f30ba49
commit
2aae04a659
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user