Set-PSReadLineOption: 找不到与参数名称匹配的参数 'PredictionViewStyle'

Set-PSReadLineOption: A parameter cannot be found that matches parameter name 'PredictionViewStyle'

我正在尝试更改 PSReadline 的 -PredictionViewStyle 选项,但出现错误“Set-PSReadLineOption:找不到与参数名称 'PredictionViewStyle' 匹配的参数。”

这是全新安装,Set-PSReadLineOption -PredictionSource History 有效。

有什么建议吗?

重新启动我的 shell 解决了问题...

打开 PowerShell

pwsh.exe -noprofile -command "Install-Module PSReadLine -Force -AllowPrerelease -SkipPublisherCheck"

Install-Module PSReadLine -Force

notepad $profile

Set-PSReadLineOption -PredictionSource History

Set-PSReadLineOption -PredictionViewStyle ListView

保存 (cntrl + S)

重启终端