PSConsoleReadLine exceptions

873 Views Asked by At

'PSReadLine' cmdlets no longer work:

PS> Set-PSReadlineOption -EditMode Vi
Set-PSReadlineOption : The type initializer for 'Microsoft.PowerShell.PSConsoleReadLine' threw an exception.
At line:1 char:1
+ Set-PSReadlineOption -EditMode Vi
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Set-PSReadlineOption], TypeInitializationException
    + FullyQualifiedErrorId : System.TypeInitializationException,Microsoft.PowerShell.SetPSReadlineOption

PS> Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadlineKeyHandler : The type initializer for 'Microsoft.PowerShell.PSConsoleReadLine' threw an exception.
At line:1 char:1
+ Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Set-PSReadLineKeyHandler], TypeInitializationException
    + FullyQualifiedErrorId : System.TypeInitializationException,Microsoft.PowerShell.SetPSReadLineKeyHandlerCommand

Yesterday, I received this Update: June 12, 2018—KB4284835 (OS Build 17134.112). Before this, I'd never had any problems with PSReadLine, and I really need it to be working...

  • PSVersion 5.1.17134.112
  • Windows 10 Home Version 1803 OS Build 17134.112
1

There are 1 best solutions below

0
On

It's a known issue in the Windows 10 October Update, and can be resolved with a patch as discussed in this Github thread.