fix: replace PowerShell 7 pipeline operator with 5.1 compatible syntax

The `||` operator is not available in Windows PowerShell 5.1.
Use if/else variable assignment instead.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
This commit is contained in:
i
2026-06-01 23:01:21 +08:00
co-authored by HAPI
parent 4f2a71c3e3
commit 43c4fbe1e8
+3 -1
View File
@@ -449,9 +449,11 @@ function Handle-HapiInstall {
if ($INSTALLED_VERSION -and $INSTALLED_VERSION -ne "unknown") { if ($INSTALLED_VERSION -and $INSTALLED_VERSION -ne "unknown") {
Write-Host "" Write-Host ""
Write-Info "检测到已安装 HAPI CLI:" Write-Info "检测到已安装 HAPI CLI:"
$cmdSource = (Get-Command hapi -ErrorAction SilentlyContinue).Source
if (-not $cmdSource) { $cmdSource = 'unknown' }
Write-Host " 版本: $INSTALLED_VERSION" -ForegroundColor White Write-Host " 版本: $INSTALLED_VERSION" -ForegroundColor White
Write-Host " 来源: $INSTALLED_SOURCE" -ForegroundColor White Write-Host " 来源: $INSTALLED_SOURCE" -ForegroundColor White
Write-Host " 路径: $((Get-Command hapi -ErrorAction SilentlyContinue).Source || 'unknown')" -ForegroundColor White Write-Host " 路径: $cmdSource" -ForegroundColor White
Write-Host " 远程: v$remoteVer" -ForegroundColor White Write-Host " 远程: v$remoteVer" -ForegroundColor White
Write-Host "" Write-Host ""