fix: use return instead of exit in iex mode to prevent closing the PowerShell host

This commit is contained in:
i
2026-06-02 01:13:51 +08:00
parent b94090c99b
commit feec8f36c2
+4 -4
View File
@@ -1062,12 +1062,12 @@ try {
if ($Upgrade) {
Invoke-Upgrade
Start-Sleep 3
exit
return
}
if ($Force -or $Source -or $SkipHub -or $InstallDir) {
Invoke-Install
Start-Sleep 3
exit
return
}
if (-not $script:STATUS_CLI_INSTALLED) {
Write-Host ""
@@ -1076,7 +1076,7 @@ try {
}
Write-Host ""
Start-Sleep 3
exit
return
}
# 交互菜单
@@ -1088,5 +1088,5 @@ try {
Write-Err "脚本错误: $_"
Write-Host "按 Enter 退出..."
$null = Read-Host
exit 1
if ($isIexExecution) { return } else { exit 1 }
}