fix(ps1): strip all non-ASCII Unicode from PowerShell scripts
Windows PowerShell 5.1 reads .ps1 files without BOM as Windows-1251 by default. Em-dashes (-) and other Unicode chars in string literals get mangled into invalid bytes (e.g. "session - no" becomes garbage that breaks the parser with "Unexpected token" errors. Replaced em-dash, en-dash, smart quotes, ellipsis, NBSP and arrows with their ASCII equivalents across all 12 .ps1 scripts (install/update/ uninstall for claude/gemini/codex/qwen). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -1,46 +1,46 @@
|
||||
# Gemini CLI — Windows Uninstaller
|
||||
# Usage: powershell -ExecutionPolicy Bypass -File gemini\ugemini_uninstall.ps1
|
||||
|
||||
$ErrorActionPreference = "Continue"
|
||||
|
||||
Write-Host ""
|
||||
Write-Host " +--------------------------------------+" -ForegroundColor Cyan
|
||||
Write-Host " | Gemini CLI -- Windows Uninstaller |" -ForegroundColor Cyan
|
||||
Write-Host " +--------------------------------------+" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
|
||||
# ---- Uninstall npm package ----
|
||||
|
||||
Write-Host " Removing @google/gemini-cli..." -ForegroundColor Cyan
|
||||
npm uninstall -g @google/gemini-cli 2>$null
|
||||
Write-Host " npm package removed" -ForegroundColor Green
|
||||
|
||||
# ---- Remove settings ----
|
||||
|
||||
$geminiDir = "$env:USERPROFILE\.gemini"
|
||||
if (Test-Path $geminiDir) {
|
||||
Write-Host " Removing $geminiDir..." -ForegroundColor Cyan
|
||||
Remove-Item -Recurse -Force $geminiDir
|
||||
Write-Host " Settings removed" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host " No settings directory found" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
# ---- Remove env vars ----
|
||||
|
||||
Write-Host " Removing environment variables..." -ForegroundColor Cyan
|
||||
[System.Environment]::SetEnvironmentVariable("GEMINI_API_KEY", $null, "User")
|
||||
[System.Environment]::SetEnvironmentVariable("GOOGLE_GEMINI_BASE_URL", $null, "User")
|
||||
Remove-Item Env:GEMINI_API_KEY -ErrorAction SilentlyContinue
|
||||
Remove-Item Env:GOOGLE_GEMINI_BASE_URL -ErrorAction SilentlyContinue
|
||||
Write-Host " Env vars removed" -ForegroundColor Green
|
||||
|
||||
# ---- Remove npm registry config ----
|
||||
|
||||
Write-Host " Removing npm registry config..." -ForegroundColor Cyan
|
||||
npm config delete "@google:registry" 2>$null
|
||||
Write-Host " Registry config removed" -ForegroundColor Green
|
||||
|
||||
Write-Host ""
|
||||
Write-Host " Gemini CLI fully uninstalled!" -ForegroundColor Green
|
||||
Write-Host ""
|
||||
# Gemini CLI - Windows Uninstaller
|
||||
# Usage: powershell -ExecutionPolicy Bypass -File gemini\ugemini_uninstall.ps1
|
||||
|
||||
$ErrorActionPreference = "Continue"
|
||||
|
||||
Write-Host ""
|
||||
Write-Host " +--------------------------------------+" -ForegroundColor Cyan
|
||||
Write-Host " | Gemini CLI -- Windows Uninstaller |" -ForegroundColor Cyan
|
||||
Write-Host " +--------------------------------------+" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
|
||||
# ---- Uninstall npm package ----
|
||||
|
||||
Write-Host " Removing @google/gemini-cli..." -ForegroundColor Cyan
|
||||
npm uninstall -g @google/gemini-cli 2>$null
|
||||
Write-Host " npm package removed" -ForegroundColor Green
|
||||
|
||||
# ---- Remove settings ----
|
||||
|
||||
$geminiDir = "$env:USERPROFILE\.gemini"
|
||||
if (Test-Path $geminiDir) {
|
||||
Write-Host " Removing $geminiDir..." -ForegroundColor Cyan
|
||||
Remove-Item -Recurse -Force $geminiDir
|
||||
Write-Host " Settings removed" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host " No settings directory found" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
# ---- Remove env vars ----
|
||||
|
||||
Write-Host " Removing environment variables..." -ForegroundColor Cyan
|
||||
[System.Environment]::SetEnvironmentVariable("GEMINI_API_KEY", $null, "User")
|
||||
[System.Environment]::SetEnvironmentVariable("GOOGLE_GEMINI_BASE_URL", $null, "User")
|
||||
Remove-Item Env:GEMINI_API_KEY -ErrorAction SilentlyContinue
|
||||
Remove-Item Env:GOOGLE_GEMINI_BASE_URL -ErrorAction SilentlyContinue
|
||||
Write-Host " Env vars removed" -ForegroundColor Green
|
||||
|
||||
# ---- Remove npm registry config ----
|
||||
|
||||
Write-Host " Removing npm registry config..." -ForegroundColor Cyan
|
||||
npm config delete "@google:registry" 2>$null
|
||||
Write-Host " Registry config removed" -ForegroundColor Green
|
||||
|
||||
Write-Host ""
|
||||
Write-Host " Gemini CLI fully uninstalled!" -ForegroundColor Green
|
||||
Write-Host ""
|
||||
|
||||
Reference in New Issue
Block a user