Codex native installation on Windows fails to update when "codex update" is called
Open 💬 6 comments Opened Jun 25, 2026 by hi-fox
What version of Codex CLI is running?
0.142
What subscription do you have?
Pro
Which model were you using?
GPT-5.5
What platform is your computer?
Windows
What terminal emulator and version are you using (if applicable)?
Windows Terminal
Codex doctor report
n/a
What issue are you seeing?
Running "codex update" in the terminal gives the following error:
Updating Codex via `powershell -ExecutionPolicy Bypass -c '$env:CODEX_NON_INTERACTIVE=1; irm https://chatgpt.com/codex/install.ps1 | iex'`...
==> Updating Codex CLI from 0.142.0 to 0.142.2
==> Detected platform: Windows (x64)
==> Resolved version: 0.142.2
==> Downloading Codex CLI
iex : The term 'Get-FileHash' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the
name, or if a path was included, verify that the path is correct and try again.
At line:1 char:75
+ ... EX_NON_INTERACTIVE=1; irm https://chatgpt.com/codex/install.ps1 | iex
+ ~~~
+ CategoryInfo : ObjectNotFound: (Get-FileHash:String) [Invoke-Expression], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.InvokeExpressionCommand
Error: `powershell -ExecutionPolicy Bypass -c '$env:CODEX_NON_INTERACTIVE=1; irm https://chatgpt.com/codex/install.ps1 | iex'` failed with status exit code: 1
The issue seems to be in the codex binary: when it spawns PowerShell to run the updater, it passes a stripped-down environment in which Get-FileHash can't be loaded. It may be an issue where powershell 7 is the default rather than powershell 5 but unsure.
What steps can reproduce the bug?
Install Codex natively on windows with the installation script (irm https://chatgpt.com/codex/install.ps1 | iex)
Then try and call codex update
What is the expected behavior?
I expect the update process to complete
Additional information
_No response_
6 Comments
I prepared a focused branch for this:
Nicolas0315:codex/windows-install-dotnet-hash55babb969 fix(install): avoid Get-FileHash dependencyWhat changed:
scripts/install/install.ps1no longer depends on theGet-FileHashcmdlet.System.Security.Cryptography.SHA256instead.Verification:
scripts/install/install.ps1Get-Sha256Digestreturns the known SHA256 forabcTest-ArchiveDigestaccepts matching digest and rejects mismatched digestgit diff --checkrtx4090: same PowerShell parser/helper test passednicolas2025: same PowerShell parser/helper test passedrtx5060ti: same PowerShell parser/helper test passedI attempted to open an upstream PR, but GitHub returned:
Nicolas0315 does not have the correct permissions to execute CreatePullRequest.SSH note:
cyberagent-mac-m5maxdoes not havepwshinstalled, andinstall.ps1is Windows-only.It's reproduced on pwsh(PowerShell 7) only.
My powershell.exe(PowerShell 5) works.
Just came there to share - yep the bug is reproducible only on pwsh
vs
looks like Pester is mandatory there to avoid such compatibility issues 😉
was there any updates on this? it's still broken for me in 0.144.3 when i updated to 0.144.4
also having this problem with 0.144.4, using powershell 5 gives me an error about
OSArchitectureproperty not being found, using powershell 7 I get the error mentioned in this issuesame thing here; nothing new here, just wanted to mention that updating through npm is a workaround on my system. this obviously bypasses powershell Get-FileHash..
Environment:
%LOCALAPPDATA%\Programs\OpenAI\Codex\bin\codex.exe