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_

View original on GitHub ↗

6 Comments

Nicolas0315 · 25 days ago

I prepared a focused branch for this:

What changed:

  • scripts/install/install.ps1 no longer depends on the Get-FileHash cmdlet.
  • Archive SHA256 is computed with .NET System.Security.Cryptography.SHA256 instead.
  • Existing checksum mismatch behavior is preserved.

Verification:

  • Local Windows: PowerShell AST parse of scripts/install/install.ps1
  • Local Windows: extracted Get-Sha256Digest returns the known SHA256 for abc
  • Local Windows: extracted Test-ArchiveDigest accepts matching digest and rejects mismatched digest
  • Local Windows: git diff --check
  • SSH rtx4090: same PowerShell parser/helper test passed
  • SSH nicolas2025: same PowerShell parser/helper test passed
  • SSH rtx5060ti: same PowerShell parser/helper test passed

I attempted to open an upstream PR, but GitHub returned: Nicolas0315 does not have the correct permissions to execute CreatePullRequest.

SSH note: cyberagent-mac-m5max does not have pwsh installed, and install.ps1 is Windows-only.

luckyabsoluter · 24 days ago

It's reproduced on pwsh(PowerShell 7) only.
My powershell.exe(PowerShell 5) works.

nos1609 · 19 days ago
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

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.4 to 0.142.5
==> Detected platform: Windows (ARM64)
==> Resolved version: 0.142.5
==> Downloading Codex CLI
iex : The term 'Get-FileHash' is not recognized as the name of a cmdlet, function, script file, or operable program. Ch
eck 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

vs

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.4 to 0.142.5
==> Detected platform: Windows (ARM64)
==> Resolved version: 0.142.5
==> Downloading Codex CLI
==> C:\Users\nos1609\AppData\Local\Programs\OpenAI\Codex\bin is already on PATH.
==> Current PowerShell session: codex
==> Future PowerShell windows: open a new PowerShell window and run: codex
Codex CLI 0.142.5 installed successfully.

🎉 Update ran successfully! Please restart Codex.

looks like Pester is mandatory there to avoid such compatibility issues 😉

hi-fox · 6 days ago

was there any updates on this? it's still broken for me in 0.144.3 when i updated to 0.144.4

Levyks · 6 days ago

also having this problem with 0.144.4, using powershell 5 gives me an error about OSArchitecture property not being found, using powershell 7 I get the error mentioned in this issue

qqq-jump · 2 days ago

same 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:

  • Windows 10 x64, build 19045
  • PowerShell 7.6.1
  • Updating Codex CLI 0.144.3 to 0.144.5
  • Active binary:

%LOCALAPPDATA%\Programs\OpenAI\Codex\bin\codex.exe