From cde26a8f7f99d36a9d56369c281425b9d1d56c40 Mon Sep 17 00:00:00 2001 From: Rick Mu Date: Fri, 13 Feb 2026 18:53:35 +1100 Subject: [PATCH] Fix: pause on error instead of closing PowerShell window Replace exit 1 with Read-Host + return so users can read the error message before the window closes. Co-Authored-By: Claude Opus 4.6 --- configure-aws-bedrock.ps1 | 2 +- install-windows-en.ps1 | 2 +- install-windows.ps1 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure-aws-bedrock.ps1 b/configure-aws-bedrock.ps1 index f566f17..a55f5db 100644 --- a/configure-aws-bedrock.ps1 +++ b/configure-aws-bedrock.ps1 @@ -7,7 +7,7 @@ $ErrorActionPreference = "Stop" function Write-Info($msg) { Write-Host "[信息] $msg" -ForegroundColor Cyan } function Write-Ok($msg) { Write-Host "[完成] $msg" -ForegroundColor Green } function Write-Warn($msg) { Write-Host "[警告] $msg" -ForegroundColor Yellow } -function Write-Err($msg) { Write-Host "[错误] $msg" -ForegroundColor Red; exit 1 } +function Write-Err($msg) { Write-Host "[错误] $msg" -ForegroundColor Red; Read-Host "按 Enter 键退出"; return } Write-Host "" Write-Host "========================================" -ForegroundColor White diff --git a/install-windows-en.ps1 b/install-windows-en.ps1 index b3da8f6..3024569 100644 --- a/install-windows-en.ps1 +++ b/install-windows-en.ps1 @@ -8,7 +8,7 @@ $ErrorActionPreference = "Stop" function Write-Info($msg) { Write-Host "[INFO] $msg" -ForegroundColor Cyan } function Write-Ok($msg) { Write-Host "[DONE] $msg" -ForegroundColor Green } function Write-Warn($msg) { Write-Host "[WARN] $msg" -ForegroundColor Yellow } -function Write-Err($msg) { Write-Host "[ERROR] $msg" -ForegroundColor Red; exit 1 } +function Write-Err($msg) { Write-Host "[ERROR] $msg" -ForegroundColor Red; Read-Host "Press Enter to exit"; return } function Write-Header { Write-Host "" diff --git a/install-windows.ps1 b/install-windows.ps1 index ac5086d..13b9b18 100644 --- a/install-windows.ps1 +++ b/install-windows.ps1 @@ -8,7 +8,7 @@ $ErrorActionPreference = "Stop" function Write-Info($msg) { Write-Host "[信息] $msg" -ForegroundColor Cyan } function Write-Ok($msg) { Write-Host "[完成] $msg" -ForegroundColor Green } function Write-Warn($msg) { Write-Host "[警告] $msg" -ForegroundColor Yellow } -function Write-Err($msg) { Write-Host "[错误] $msg" -ForegroundColor Red; exit 1 } +function Write-Err($msg) { Write-Host "[错误] $msg" -ForegroundColor Red; Read-Host "按 Enter 键退出"; return } function Write-Header { Write-Host ""