1

'PSReadLine' cmdlet 不再起作用:

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

昨天,我收到了此更新:2018 年 6 月 12 日—KB4284835(操作系统内部版本 17134.112)。在此之前,我从来没有遇到过任何问题PSReadLine,我真的需要它来工作......

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

1 回答 1

0

这是 Windows 10 十月更新中的一个已知问题,可以通过此 Github 线程中讨论的补丁解决。

于 2019-03-01T15:57:41.210 回答