From b7a335b409eb94f877e44f16916b47b5690afe73 Mon Sep 17 00:00:00 2001 From: delta-cloud-208e Date: Sun, 8 Mar 2026 08:08:42 +0000 Subject: [PATCH] fix: use dot-sourcing instead of child PowerShell process MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit powershell -File runs script in child process — PATH changes don't persist. Changed to Set-ExecutionPolicy + dot-sourcing (. script.ps1) which runs in current session. Also added PATH restart hint to Codex install/update scripts. Co-Authored-By: Claude Opus 4.6 --- README.md | 33 +++++++++++++++++++++------------ codex/ucodex_install.ps1 | 3 +++ codex/ucodex_update.ps1 | 3 +++ 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index c14d69d..a6a00e7 100755 --- a/README.md +++ b/README.md @@ -102,8 +102,9 @@ curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \ **Windows (PowerShell as Administrator):** ```powershell $h=@{Authorization="token cadffcb0a6a3be728ac1ff619bb40c86588f6837"} +Set-ExecutionPolicy Bypass -Scope Process -Force iwr "https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/claude/uclaude_install.ps1" -OutFile "$env:TEMP\uclaude_install.ps1" -Headers $h -powershell -ExecutionPolicy Bypass -File "$env:TEMP\uclaude_install.ps1" +. "$env:TEMP\uclaude_install.ps1" ``` ### Gemini CLI — Install @@ -172,8 +173,9 @@ curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \ Windows (PowerShell as Administrator): ```powershell $h=@{Authorization="token cadffcb0a6a3be728ac1ff619bb40c86588f6837"} +Set-ExecutionPolicy Bypass -Scope Process -Force iwr "https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/gemini/ugemini_install.ps1" -OutFile "$env:TEMP\ugemini_install.ps1" -Headers $h -powershell -ExecutionPolicy Bypass -File "$env:TEMP\ugemini_install.ps1" +. "$env:TEMP\ugemini_install.ps1" ``` See [gemini/README.md](gemini/README.md) for details. @@ -192,8 +194,9 @@ curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \ **Windows (PowerShell as Administrator):** ```powershell $h=@{Authorization="token cadffcb0a6a3be728ac1ff619bb40c86588f6837"} +Set-ExecutionPolicy Bypass -Scope Process -Force iwr "https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/codex/ucodex_install.ps1" -OutFile "$env:TEMP\ucodex_install.ps1" -Headers $h -powershell -ExecutionPolicy Bypass -File "$env:TEMP\ucodex_install.ps1" +. "$env:TEMP\ucodex_install.ps1" ``` Verify: `codex exec "Hello"` @@ -237,8 +240,9 @@ curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \ Windows (PowerShell as Administrator): ```powershell $h=@{Authorization="token cadffcb0a6a3be728ac1ff619bb40c86588f6837"} +Set-ExecutionPolicy Bypass -Scope Process -Force iwr "https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/qwen/uqwen_install.ps1" -OutFile "$env:TEMP\uqwen_install.ps1" -Headers $h -powershell -ExecutionPolicy Bypass -File "$env:TEMP\uqwen_install.ps1" +. "$env:TEMP\uqwen_install.ps1" ``` See [qwen/README.md](qwen/README.md) for details, models, and troubleshooting. @@ -277,7 +281,8 @@ curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \ ```powershell $h=@{Authorization="token cadffcb0a6a3be728ac1ff619bb40c86588f6837"} iwr "https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/claude/uclaude_update.ps1" -OutFile "$env:TEMP\uclaude_update.ps1" -Headers $h -powershell -ExecutionPolicy Bypass -File "$env:TEMP\uclaude_update.ps1" +Set-ExecutionPolicy Bypass -Scope Process -Force +. "$env:TEMP\uclaude_update.ps1" ``` ### Gemini CLI — Update @@ -293,7 +298,8 @@ curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \ ```powershell $h=@{Authorization="token cadffcb0a6a3be728ac1ff619bb40c86588f6837"} iwr "https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/gemini/ugemini_update.ps1" -OutFile "$env:TEMP\ugemini_update.ps1" -Headers $h -powershell -ExecutionPolicy Bypass -File "$env:TEMP\ugemini_update.ps1" +Set-ExecutionPolicy Bypass -Scope Process -Force +. "$env:TEMP\ugemini_update.ps1" ``` ### Codex CLI — Update @@ -309,7 +315,8 @@ curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \ ```powershell $h=@{Authorization="token cadffcb0a6a3be728ac1ff619bb40c86588f6837"} iwr "https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/codex/ucodex_update.ps1" -OutFile "$env:TEMP\ucodex_update.ps1" -Headers $h -powershell -ExecutionPolicy Bypass -File "$env:TEMP\ucodex_update.ps1" +Set-ExecutionPolicy Bypass -Scope Process -Force +. "$env:TEMP\ucodex_update.ps1" ``` ### Qwen Code — Update @@ -325,7 +332,8 @@ curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \ ```powershell $h=@{Authorization="token cadffcb0a6a3be728ac1ff619bb40c86588f6837"} iwr "https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/qwen/uqwen_update.ps1" -OutFile "$env:TEMP\uqwen_update.ps1" -Headers $h -powershell -ExecutionPolicy Bypass -File "$env:TEMP\uqwen_update.ps1" +Set-ExecutionPolicy Bypass -Scope Process -Force +. "$env:TEMP\uqwen_update.ps1" ``` ## Uninstall @@ -356,22 +364,23 @@ curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \ **Windows (PowerShell as Administrator):** ```powershell $h=@{Authorization="token cadffcb0a6a3be728ac1ff619bb40c86588f6837"} +Set-ExecutionPolicy Bypass -Scope Process -Force # Claude Code iwr "https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/claude/uclaude_uninstall.ps1" -OutFile "$env:TEMP\uclaude_uninstall.ps1" -Headers $h -powershell -ExecutionPolicy Bypass -File "$env:TEMP\uclaude_uninstall.ps1" +. "$env:TEMP\uclaude_uninstall.ps1" # Gemini CLI iwr "https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/gemini/ugemini_uninstall.ps1" -OutFile "$env:TEMP\ugemini_uninstall.ps1" -Headers $h -powershell -ExecutionPolicy Bypass -File "$env:TEMP\ugemini_uninstall.ps1" +. "$env:TEMP\ugemini_uninstall.ps1" # Codex CLI iwr "https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/codex/ucodex_uninstall.ps1" -OutFile "$env:TEMP\ucodex_uninstall.ps1" -Headers $h -powershell -ExecutionPolicy Bypass -File "$env:TEMP\ucodex_uninstall.ps1" +. "$env:TEMP\ucodex_uninstall.ps1" # Qwen Code iwr "https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/qwen/uqwen_uninstall.ps1" -OutFile "$env:TEMP\uqwen_uninstall.ps1" -Headers $h -powershell -ExecutionPolicy Bypass -File "$env:TEMP\uqwen_uninstall.ps1" +. "$env:TEMP\uqwen_uninstall.ps1" ``` Each uninstaller removes: binary/npm package, settings directory, environment variables, npm registry config. diff --git a/codex/ucodex_install.ps1 b/codex/ucodex_install.ps1 index 4eee55a..64db5b0 100644 --- a/codex/ucodex_install.ps1 +++ b/codex/ucodex_install.ps1 @@ -234,3 +234,6 @@ try { } Write-Host "" +Write-Host " NOTE: If 'codex' is not recognized, restart PowerShell or run:" -ForegroundColor Yellow +Write-Host ' $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")' -ForegroundColor Yellow +Write-Host "" diff --git a/codex/ucodex_update.ps1 b/codex/ucodex_update.ps1 index facd897..6784d51 100644 --- a/codex/ucodex_update.ps1 +++ b/codex/ucodex_update.ps1 @@ -115,3 +115,6 @@ Remove-Item -Recurse -Force $patchDir -ErrorAction SilentlyContinue Write-Host "" Write-Host " Update complete!" -ForegroundColor Green Write-Host "" +Write-Host " NOTE: If 'codex' is not recognized, restart PowerShell or run:" -ForegroundColor Yellow +Write-Host ' $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")' -ForegroundColor Yellow +Write-Host ""