install.ps1 Crashes on Windows 10 with PS 5.1
Open 💬 2 comments Opened Apr 25, 2026 by reard3n
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_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗