Normalize v prefix in install.ps1 agent version check

The Windows installer compared the downloaded agent's --version output
(v6.0.5) against the server's /api/version value (6.0.5) literally, so
every matching install still warned about a version mismatch (#1527).
Strip the leading v from both sides before comparing, matching what
install.sh already does.
This commit is contained in:
rcourtman 2026-07-16 09:16:51 +01:00
parent 84d43e16e4
commit 4421945e9b

View file

@ -873,7 +873,10 @@ try {
$DownloadedVersion = ""
}
if (-not [string]::IsNullOrWhiteSpace($ServerVersion) -and -not [string]::IsNullOrWhiteSpace($DownloadedVersion) -and $DownloadedVersion -ne $ServerVersion) {
$DownloadedVersionNormalized = $DownloadedVersion.TrimStart('v')
$ServerVersionNormalized = $ServerVersion.TrimStart('v')
if (-not [string]::IsNullOrWhiteSpace($ServerVersion) -and -not [string]::IsNullOrWhiteSpace($DownloadedVersion) -and $DownloadedVersionNormalized -ne $ServerVersionNormalized) {
Write-Host "Warning: downloaded agent version ($DownloadedVersion) does not match Pulse server version ($ServerVersion). Check that Pulse is upgraded and that any reverse proxy is not serving a stale cached binary." -ForegroundColor Yellow
}