fix: 修复一键安装命令在 irm|iex 场景下的 BOM 报错
install.ps1 为兼容 Windows PowerShell 5.1 的 -File 加载场景带有 UTF-8 BOM, 但 irm 拉取内容再交给 iex 执行时不会自动剥离 BOM 字节,导致其被解码为字符串 里的 U+FEFF 字符,紧贴首行注释符 # 被解析器当作未知命令,报错但不影响最终结果。 改为先 TrimStart([char]0xFEFF) 再 iex,兼容 PS 5.1 和 PS 7。同时把 Windows 一节标题和说明明确标注 PowerShell,避免有人用 cmd 执行。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NTuSGDEryaM7BUop9wNni9
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
b8f30dcc9f
commit
634d38d414
@@ -16,12 +16,12 @@
|
||||
curl -fsSL https://gitea.rk-health.com/jiangshunzhi/Gemini-in-Chrome/raw/branch/main/install.sh | bash
|
||||
```
|
||||
|
||||
### Windows
|
||||
### Windows(PowerShell)
|
||||
|
||||
打开 PowerShell 执行:
|
||||
打开 PowerShell(不是 cmd)执行:
|
||||
|
||||
```powershell
|
||||
irm https://gitea.rk-health.com/jiangshunzhi/Gemini-in-Chrome/raw/branch/main/install.ps1 | iex
|
||||
iex ((irm https://gitea.rk-health.com/jiangshunzhi/Gemini-in-Chrome/raw/branch/main/install.ps1).TrimStart([char]0xFEFF))
|
||||
```
|
||||
|
||||
## 脚本做了什么
|
||||
|
||||
Reference in New Issue
Block a user