首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >升级到PS7.2后PSReadLine抛出异常

升级到PS7.2后PSReadLine抛出异常
EN

Stack Overflow用户
提问于 2021-11-19 04:24:47
回答 1查看 274关注 0票数 0

使用PSReadLine升级到Powershell 7.2.0后引发的异常

代码语言:javascript
复制
### Environment
PSReadLine: 2.2.0-beta1
PowerShell: 7.2.0
OS: Microsoft Windows 10.0.22000
BufferWidth: 309
BufferHeight: 55

Last 0 Keys


System.TypeLoadException: Could not load type 'System.Management.Automation.Subsystem.PredictionResult' from assembly 'Microsoft.PowerShell.PSReadLine.Polyfiller, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
   at Microsoft.PowerShell.PSConsoleReadLine.PredictionViewBase.Reset()
   at Microsoft.PowerShell.PSConsoleReadLine.PredictionInlineView.Reset()
   at Microsoft.PowerShell.PSConsoleReadLine.Prediction.Reset()
   at Microsoft.PowerShell.PSConsoleReadLine.Initialize(Runspace runspace, EngineIntrinsics engineIntrinsics)
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-11-19 04:24:47

正如这条线中提到的,这个问题可以由

这个问题在2.2.0-beta3版本的PSReadLine中得到了修正。您可以通过升级到最新的2.2.0beta4版本的PSReadLine来解决这个问题。这样做的指示: 1:停止pwsh的所有实例。 2:从cmd.exe运行: pwsh -noprofile -command“安装-模块PSReadLine -AllowPrerelease -Force”

此外,如果您希望卸载以前的安装程序,请按照以下步骤操作

如果您想删除测试版的PSReadLine并使用随PowerShell 7.2附带的2.1.0版本的PSReadLine,您可以: 1:运行pwsh -noprofile -noninteractive启动pwsh而不加载PSReadLine 2:运行Uninstall-Module -Name PSReadLine -RequiredVersion <2.2.0-beta1 or 2.2.0-beta2> -AllowPrerelease删除模块。或者,您可以手动删除该模块文件夹。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70029854

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档