codex - 💡(How to fix) Fix install.ps1 Crashes on Windows 10 with PS 5.1 [1 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#19559Fetched 2026-04-26 05:15:03
View on GitHub
Comments
1
Participants
1
Timeline
6
Reactions
0
Author
Participants
Timeline (top)
labeled ×3commented ×1mentioned ×1subscribed ×1

Error Message

PS C:\users\user\Downloads> .\install.ps1

Security warning Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your computer. If you trust this script, use the Unblock-File cmdlet to allow the script to run without this warning message. Do you want to run C:\users\user\Downloads\install.ps1? [D] Do not run [R] Run once [S] Suspend [?] Help (default is "D"): R The property 'OSArchitecture' cannot be found on this object. Verify that the property exists. At C:\users\user\Downloads\install.ps1:584 char:1

  • $architecture = [System.Runtime.InteropServices.RuntimeInformation]:: ...
  •   + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException
      + FullyQualifiedErrorId : PropertyNotFoundStrict

PS C:\users\user\Downloads>

Fix Action

Fix / Workaround

I've modeled this behavior in this patch: https://github.com/openai/codex/compare/main...reard3n:codex:installer-bugfix?expand=1

Code Example

PS C:\users\user\Downloads> .\install.ps1

Security warning
Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your
computer. If you trust this script, use the Unblock-File cmdlet to allow the script to run without this warning
message. Do you want to run C:\users\user\Downloads\install.ps1?
[D] Do not run  [R] Run once  [S] Suspend  [?] Help (default is "D"): R
The property 'OSArchitecture' cannot be found on this object. Verify that the property exists.
At C:\users\user\Downloads\install.ps1:584 char:1
+ $architecture = [System.Runtime.InteropServices.RuntimeInformation]:: ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : PropertyNotFoundStrict

PS C:\users\user\Downloads>

---

Get-ComputerInfo | Select-Object WindowsProductName, WindowsVersion, OsHardwareAbstractionLayer
>>

WindowsProductName WindowsVersion OsHardwareAbstractionLayer
------------------ -------------- --------------------------
Windows 10 Pro     2009           10.0.26100.1

---

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.26100.8115
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.26100.8115
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

---

The property 'OSArchitecture' cannot be found on this object. Verify that the property exists.
At C:\users\user\Downloads\install.ps1:584 char:1
+ $architecture = [System.Runtime.InteropServices.RuntimeInformation]:: ...
RAW_BUFFERClick to expand / collapse

What issue are you seeing?

Running install.ps1 on Windows 10 with PS 5.1 results in a crash to the whole install script:

PS C:\users\user\Downloads> .\install.ps1

Security warning
Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your
computer. If you trust this script, use the Unblock-File cmdlet to allow the script to run without this warning
message. Do you want to run C:\users\user\Downloads\install.ps1?
[D] Do not run  [R] Run once  [S] Suspend  [?] Help (default is "D"): R
The property 'OSArchitecture' cannot be found on this object. Verify that the property exists.
At C:\users\user\Downloads\install.ps1:584 char:1
+ $architecture = [System.Runtime.InteropServices.RuntimeInformation]:: ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : PropertyNotFoundStrict

PS C:\users\user\Downloads>

What steps can reproduce the bug?

Download and run the script on Windows 10, with PS 5.1.X

Get-ComputerInfo | Select-Object WindowsProductName, WindowsVersion, OsHardwareAbstractionLayer
>>

WindowsProductName WindowsVersion OsHardwareAbstractionLayer
------------------ -------------- --------------------------
Windows 10 Pro     2009           10.0.26100.1
$PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.26100.8115
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.26100.8115
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Observe this error when executing:

The property 'OSArchitecture' cannot be found on this object. Verify that the property exists.
At C:\users\user\Downloads\install.ps1:584 char:1
+ $architecture = [System.Runtime.InteropServices.RuntimeInformation]:: ...

What is the expected behavior?

The script should function even on older versions of powershell, with graceful fallback to other detection methods.

I've modeled this behavior in this patch: https://github.com/openai/codex/compare/main...reard3n:codex:installer-bugfix?expand=1

Additional information

No response

extent analysis

TL;DR

The issue can be fixed by updating the script to handle the missing 'OSArchitecture' property in PowerShell 5.1.

Guidance

  • The error occurs because the OSArchitecture property is not available in PowerShell 5.1, so the script needs to be modified to handle this case.
  • The provided patch (https://github.com/openai/codex/compare/main...reard3n:codex:installer-bugfix?expand=1) seems to address this issue by adding a fallback detection method.
  • To verify the fix, run the updated script on Windows 10 with PowerShell 5.1 and check if it completes without errors.
  • Consider testing the script on different PowerShell versions to ensure compatibility.

Example

No code snippet is provided as the issue is related to a specific script and the fix is already available in the provided patch.

Notes

The fix relies on the provided patch, which may need to be reviewed and tested thoroughly to ensure it works as expected.

Recommendation

Apply the workaround by incorporating the changes from the provided patch, as it seems to address the issue and provides a fallback detection method for older PowerShell versions.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix install.ps1 Crashes on Windows 10 with PS 5.1 [1 comments, 1 participants]