'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