fix: use return instead of exit in iex mode to prevent closing the PowerShell host
This commit is contained in:
+4
-4
@@ -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 }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user