admin管理员组

文章数量:1535335

最近在学习 core,用vs2019 将数据库模型更新到代码中的时候需要执行

Scaffold-DbContext "Server=.;Database=数据库名称;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models

出现了

PowerShell version 2.0 is not supported. Please upgrade PowerShell to 3.0 or greater and restart Visual Studio.

的错误

解决方法是需要安装微软的 Management Framework 3.0

下载地址:https://www.microsoft/en-us/download/details.aspx?id=34595

不过在安装的时候还会报:0x80070422 的错误

需要我们在 服务 中启动 ASP.NET 状态服务Windows Update

然后重新安装 Management Framework 3.0 即可

重启电脑,在所有程序中找到 Windows PowerShell 打开后输入 $PSVersionTable.PSVersion,版本变为 3

本文标签: 升级到报错解决方法powershellFramework