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:
+3
-1
@@ -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 ""
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user