diff --git a/ClaudeCode/setup-claude-code.ps1 b/ClaudeCode/setup-claude-code.ps1 index a5f0c8e..a832a78 100644 --- a/ClaudeCode/setup-claude-code.ps1 +++ b/ClaudeCode/setup-claude-code.ps1 @@ -101,11 +101,11 @@ function Install-Fnm { try { if (Test-Command "winget") { Write-Info "使用 winget 安装 fnm..." - & winget install Schniz.fnm -e --accept-source-agreements --accept-package-agreements + & winget install Schniz.fnm -e --accept-source-agreements --accept-package-agreements | Out-Host } else { Write-Info "使用 PowerShell 脚本安装 fnm..." - Invoke-Expression "& { $(Invoke-RestMethod https://fnm.vercel.app/install.ps1) }" + Invoke-Expression "& { $(Invoke-RestMethod https://fnm.vercel.app/install.ps1) }" | Out-Host } Refresh-Path @@ -114,7 +114,7 @@ function Install-Fnm { Write-Success "fnm 安装成功!" $fnmEnv = & fnm env --use-on-cd 2>$null if ($fnmEnv) { - $fnmEnv | Out-String | Invoke-Expression + $fnmEnv | Out-String | Invoke-Expression | Out-Null } return $true } @@ -134,9 +134,9 @@ function Install-NodeWithFnm { Write-Info "使用 fnm 安装 Node.js 24.x..." try { - & fnm install 24 - & fnm use 24 - & fnm default 24 + & fnm install 24 | Out-Host + & fnm use 24 | Out-Host + & fnm default 24 | Out-Host Refresh-Path if (Test-Command "node") { @@ -204,7 +204,7 @@ function Install-Tool { Write-Host " 执行: npm install -g $ToolPackage" -ForegroundColor Gray try { - Invoke-Expression "npm install -g $ToolPackage" + Invoke-Expression "npm install -g $ToolPackage" | Out-Host $exitCode = $LASTEXITCODE Refresh-Path diff --git a/GeminiCLI/setup-gemini.ps1 b/GeminiCLI/setup-gemini.ps1 index eb5df40..e1f13cc 100644 --- a/GeminiCLI/setup-gemini.ps1 +++ b/GeminiCLI/setup-gemini.ps1 @@ -99,11 +99,11 @@ function Install-Fnm { try { if (Test-Command "winget") { Write-Info "使用 winget 安装 fnm..." - & winget install Schniz.fnm -e --accept-source-agreements --accept-package-agreements + & winget install Schniz.fnm -e --accept-source-agreements --accept-package-agreements | Out-Host } else { Write-Info "使用 PowerShell 脚本安装 fnm..." - Invoke-Expression "& { $(Invoke-RestMethod https://fnm.vercel.app/install.ps1) }" + Invoke-Expression "& { $(Invoke-RestMethod https://fnm.vercel.app/install.ps1) }" | Out-Host } Refresh-Path @@ -112,7 +112,7 @@ function Install-Fnm { Write-Success "fnm 安装成功!" $fnmEnv = & fnm env --use-on-cd 2>$null if ($fnmEnv) { - $fnmEnv | Out-String | Invoke-Expression + $fnmEnv | Out-String | Invoke-Expression | Out-Null } return $true } @@ -132,9 +132,9 @@ function Install-NodeWithFnm { Write-Info "使用 fnm 安装 Node.js 24.x..." try { - & fnm install 24 - & fnm use 24 - & fnm default 24 + & fnm install 24 | Out-Host + & fnm use 24 | Out-Host + & fnm default 24 | Out-Host Refresh-Path if (Test-Command "node") { @@ -203,7 +203,7 @@ function Install-Tool { Write-Host " 执行: $installCmd" -ForegroundColor Gray try { - Invoke-Expression $installCmd + Invoke-Expression $installCmd | Out-Host $exitCode = $LASTEXITCODE Refresh-Path diff --git a/codex/setup-codex.ps1 b/codex/setup-codex.ps1 index fc5a031..b52683f 100644 --- a/codex/setup-codex.ps1 +++ b/codex/setup-codex.ps1 @@ -101,11 +101,11 @@ function Install-Fnm { try { if (Test-Command "winget") { Write-Info "使用 winget 安装 fnm..." - & winget install Schniz.fnm -e --accept-source-agreements --accept-package-agreements + & winget install Schniz.fnm -e --accept-source-agreements --accept-package-agreements | Out-Host } else { Write-Info "使用 PowerShell 脚本安装 fnm..." - Invoke-Expression "& { $(Invoke-RestMethod https://fnm.vercel.app/install.ps1) }" + Invoke-Expression "& { $(Invoke-RestMethod https://fnm.vercel.app/install.ps1) }" | Out-Host } Refresh-Path @@ -114,7 +114,7 @@ function Install-Fnm { Write-Success "fnm 安装成功!" $fnmEnv = & fnm env --use-on-cd 2>$null if ($fnmEnv) { - $fnmEnv | Out-String | Invoke-Expression + $fnmEnv | Out-String | Invoke-Expression | Out-Null } return $true } @@ -134,9 +134,9 @@ function Install-NodeWithFnm { Write-Info "使用 fnm 安装 Node.js 24.x..." try { - & fnm install 24 - & fnm use 24 - & fnm default 24 + & fnm install 24 | Out-Host + & fnm use 24 | Out-Host + & fnm default 24 | Out-Host Refresh-Path if (Test-Command "node") { @@ -205,7 +205,7 @@ function Install-Tool { Write-Host " 执行: $installCmd" -ForegroundColor Gray try { - Invoke-Expression $installCmd + Invoke-Expression $installCmd | Out-Host $exitCode = $LASTEXITCODE Refresh-Path diff --git a/setup-claude-code.ps1 b/setup-claude-code.ps1 index a5f0c8e..a832a78 100644 --- a/setup-claude-code.ps1 +++ b/setup-claude-code.ps1 @@ -101,11 +101,11 @@ function Install-Fnm { try { if (Test-Command "winget") { Write-Info "使用 winget 安装 fnm..." - & winget install Schniz.fnm -e --accept-source-agreements --accept-package-agreements + & winget install Schniz.fnm -e --accept-source-agreements --accept-package-agreements | Out-Host } else { Write-Info "使用 PowerShell 脚本安装 fnm..." - Invoke-Expression "& { $(Invoke-RestMethod https://fnm.vercel.app/install.ps1) }" + Invoke-Expression "& { $(Invoke-RestMethod https://fnm.vercel.app/install.ps1) }" | Out-Host } Refresh-Path @@ -114,7 +114,7 @@ function Install-Fnm { Write-Success "fnm 安装成功!" $fnmEnv = & fnm env --use-on-cd 2>$null if ($fnmEnv) { - $fnmEnv | Out-String | Invoke-Expression + $fnmEnv | Out-String | Invoke-Expression | Out-Null } return $true } @@ -134,9 +134,9 @@ function Install-NodeWithFnm { Write-Info "使用 fnm 安装 Node.js 24.x..." try { - & fnm install 24 - & fnm use 24 - & fnm default 24 + & fnm install 24 | Out-Host + & fnm use 24 | Out-Host + & fnm default 24 | Out-Host Refresh-Path if (Test-Command "node") { @@ -204,7 +204,7 @@ function Install-Tool { Write-Host " 执行: npm install -g $ToolPackage" -ForegroundColor Gray try { - Invoke-Expression "npm install -g $ToolPackage" + Invoke-Expression "npm install -g $ToolPackage" | Out-Host $exitCode = $LASTEXITCODE Refresh-Path diff --git a/setup.ps1 b/setup.ps1 index d9f4dfd..c26c4a6 100644 --- a/setup.ps1 +++ b/setup.ps1 @@ -107,12 +107,12 @@ function Install-Fnm { # 使用 winget 安装 fnm if (Test-Command "winget") { Write-Info "使用 winget 安装 fnm..." - & winget install Schniz.fnm -e --accept-source-agreements --accept-package-agreements + & winget install Schniz.fnm -e --accept-source-agreements --accept-package-agreements | Out-Host } else { # 备选:使用 cargo 或手动下载 Write-Info "使用 PowerShell 脚本安装 fnm..." - Invoke-Expression "& { $(Invoke-RestMethod https://fnm.vercel.app/install.ps1) }" + Invoke-Expression "& { $(Invoke-RestMethod https://fnm.vercel.app/install.ps1) }" | Out-Host } Refresh-Path @@ -123,7 +123,7 @@ function Install-Fnm { # 初始化 fnm $fnmEnv = & fnm env --use-on-cd 2>$null if ($fnmEnv) { - $fnmEnv | Out-String | Invoke-Expression + $fnmEnv | Out-String | Invoke-Expression | Out-Null } return $true } @@ -144,9 +144,9 @@ function Install-NodeWithFnm { Write-Info "使用 fnm 安装 Node.js 24.x..." try { - & fnm install 24 - & fnm use 24 - & fnm default 24 + & fnm install 24 | Out-Host + & fnm use 24 | Out-Host + & fnm default 24 | Out-Host Refresh-Path if (Test-Command "node") { @@ -226,7 +226,7 @@ function Install-Tool { Write-Host " 执行: $installCmd" -ForegroundColor Gray try { - Invoke-Expression $installCmd + Invoke-Expression $installCmd | Out-Host $exitCode = $LASTEXITCODE Refresh-Path @@ -272,10 +272,10 @@ function Invoke-RemoteSetup { # 执行脚本,正确传递参数 $LASTEXITCODE = 0 if ($ApiKey) { - & $tempFile -ApiKey $ApiKey + & $tempFile -ApiKey $ApiKey | Out-Host } else { - & $tempFile + & $tempFile | Out-Host } $scriptSucceeded = $?