question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Get-PSReadLineOption : The type initializer for 'Microsoft.PowerShell.PSConsoleReadLine' threw an exception.

See original GitHub issue

Environment data

& {
    "PS version: $($PSVersionTable.PSVersion)"
    "PSReadline version: $((Get-Module PSReadline).Version)"
    if ($IsLinux -or $IsOSX) {
        "os: $(uname -a)"
    } else {
        "os: $((dir $env:SystemRoot\System32\cmd.exe).VersionInfo.FileVersion)"
    }
    "PS file version: $((dir $pshome\pwsh.exe).VersionInfo.FileVersion)"
}
PS version: 6.0.0-rc.2
PSReadline version: 2.0.0
os: 6.1.7601.17514 (win7sp1_rtm.101119-1850)
PS file version: 6.0.0
$PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.0.0-rc.2
PSEdition                      Core
GitCommitId                    v6.0.0-rc.2
OS                             Microsoft Windows 6.1.7601 S
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0, 5.0, 5.1.10032.0, 6.0.0-rc.2}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Steps to reproduce or exception report

Get-PSReadLineOption
Get-PSReadLineOption : The type initializer for 'Microsoft.PowerShell.PSConsoleReadLine' threw an exception.
At line:1 char:1
+ Get-PSReadLineOption
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Get-PSReadLineOption], TypeInitializationException
+ FullyQualifiedErrorId : System.TypeInitializationException,Microsoft.PowerShell.GetPSReadLineOption
Get-PSReadLineKeyHandler
Get-PSReadLineKeyHandler : The type initializer for 'Microsoft.PowerShell.PSConsoleReadLine' threw an exception.
At line:1 char:1
+ Get-PSReadLineKeyHandler
+ ~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Get-PSReadLineKeyHandler], TypeInitializationException
+ FullyQualifiedErrorId : System.TypeInitializationException,Microsoft.PowerShell.GetKeyHandlerCommand

note : the issue template dont reference ‘pwsh.exe’

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:29 (11 by maintainers)

github_iconTop GitHub Comments

3reactions
SteveL-MSFTcommented, Oct 28, 2018

@eliohann you would need a new build of PSReadLine. There isn’t a new beta coming soon, but you can pick up the nightly build which has the fix: https://ci.appveyor.com/project/lzybkr/PSReadLine/branch/master/artifacts

2reactions
Nicolas01commented, Nov 12, 2018

@eliohann I installed the nightly build by replacing files in C:\Program Files\WindowsPowerShell\Modules\PSReadline\2.0.0 And now it works with my custom keyboard layout !

Read more comments on GitHub >

github_iconTop Results From Across the Web

PSConsoleReadLine exceptions - powershell
It's a known issue in the Windows 10 October Update, and can be resolved with a patch as discussed in this Github thread....
Read more >
[Solved] PSReadLine not working in PowerShell 6
PowerShell.GetKeyHandlerCommand. Get-PSReadLineOption : The type initializer for 'Microsoft.PowerShell.PSConsoleReadLine' threw an exception ...
Read more >
PowerShell history is not working? Check out these solutions
Get -PSReadLineOption : The type initializer for 'Microsoft.PowerShell.PSConsoleReadLine' threw an exception. At line:1 char:1
Read more >
PSReadline 2.0 not working on Windows 10 1809
It throws the following error: “The type initializer for 'Microsoft.PowerShell.PSConsoleReadLine' threw an exception.” Solution: I had a look ...
Read more >
Updating help for the PSReadLine module in Windows ...
Fortunately the fix is simple. Just rename the folder to C:\Program Files\WindowsPowerShell\Modules\PSReadLine . To rename this folder, you must ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found