[英]PowerShell not working on Windows 2008 R2
I have accidently installed .Net 4.5 on my Windows Server 2008 R2 for PowerShell 5.1, but now I have reverted to .Net 4.0 version and now the PowerShell is not working. 我在Windows Server 2008 R2的PowerShell 5.1上意外安装了.Net 4.5,但是现在我恢复到.Net 4.0版本,并且PowerShell无法正常工作。 It gives below error. 它给出以下错误。
Windows PowerShell terminated with the following error: Method not found: 'System.Threading.Tasks.Task System.Threading.Tasks.Task.Run(System.Action)' Windows PowerShell终止,出现以下错误:找不到方法:'System.Threading.Tasks.Task System.Threading.Tasks.Task.Run(System.Action)'
What should I do to resolve this? 我应该怎么做才能解决这个问题?
Perhaps this is the same issue you have: https://michlstechblog.info/blog/powershell-method-not-found-system-threading-tasks-task-system-threading-tasks-task-runsystem-action/ 也许这是您遇到的相同问题: https : //michlstechblog.info/blog/powershell-method-not-found-system-threading-tasks-task-system-threading-tasks-task-runsystem-action/
If that does not work for you, you can always reinstall Powershell 3.0. 如果这对您不起作用,则始终可以重新安装Powershell 3.0。 Download it from https://www.microsoft.com/en-us/download/details.aspx?id=34595 从https://www.microsoft.com/zh-cn/download/details.aspx?id=34595下载
You can also install a higher version if you would like. 如果愿意,您也可以安装更高版本。 It would do no harm. 不会有任何伤害。 Reinstall will require a reboot as they come in the form of KBs. 重新安装将需要重新启动,因为它们以KB的形式出现。
You will need to download Windows Management Framework 3.0 or install Microsoft .NET Framework 4.5 to correct your issue. 您将需要下载Windows Management Framework 3.0或安装Microsoft .NET Framework 4.5来解决此问题。
Windows Management Framework 3.0 - link Windows Management Framework 3.0- 链接
Microsoft .NET Framework 4.0 - link Microsoft .NET Framework 4.0- 链接
or you can get 或者你可以得到
Windows Management Framework 4.0 - link Windows Management Framework 4.0- 链接
Microsoft .NET Framework 4.5 - link Microsoft .NET Framework 4.5- 链接
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.