The Install.ps1 doesn't return OSArchitecture correctly for all Windows PowerShell Versions Correctly
Open 💬 2 comments Opened May 2, 2026 by thedwindlingdba
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What issue are you seeing?
The Install.ps1 is leveraging this to pull the OS Architecture
$architecture = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture
Under certain PowerShell configurations, that specific Property is filtered out, so it returns nothing and the script produces an error.
To ensure it returns properly across all PowerShell configurations. You should utilize this
$architecture = [System.Runtime.InteropServices.RuntimeInformation,mscorlib]::OSArchitecture.ToString().ToLower()
What steps can reproduce the bug?
Open PowerShell 7 or 5.1
Install-Module PSReadLine -force
Import-Module PSReadline
.\Install.ps1
Observe the error message that OSArchitecture doesn't exist on said object.
What is the expected behavior?
The script succeeds and doesn't produce an error
Additional information
_No response_
2 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Not a solution, but a potential workaround is to use the
pwsh: