简体   繁体   English

PowerShell无法在Windows 2008 R2上运行

[英]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.

相关问题 Powershell 4与Windows 2008 R2的兼容性 - Powershell 4 compatibility with Windows 2008 r2 Windows Server 2008 R2 PowerShell和Internet Explorer 9 - Windows Server 2008 R2 PowerShell and Internet Explorer 9 使用Powershell Windows Server 2008 R2将用户导入本地 - Import users to local with powershell windows server 2008 r2 更改芬兰语Windows Server 2008 R2上Powershell脚本的文化 - Change culture on Finnish Windows Server 2008 R2 for Powershell Script Windows Server 2008 R2使用Powershell编辑网络设置 - Windows Server 2008 R2 editing network settings with powershell 在 Windows Server 2008 R2 上的 PowerShell 中创建专用队列 - Creating private queues in PowerShell on Windows Server 2008 R2 是否会为在Win Server 2008 R2上运行的Windows 7开发PowerShell脚本? - Will a PowerShell script developed for a Windows 7 run on Win Server 2008 R2? 使用Powershell激活Windows 2008 R2 Server - Use Powershell to Activate Windows 2008 R2 Server Powershell脚本在Windows 2008 R2上运行良好,但在Windows 2012 R2上不执行任何操作 - Powershell script runs fine on Windows 2008 R2 but does nothing on Windows 2012 R2 TFS Power Tools 2008 Powershell Snapin将无法在Windows 2008 R2中以64位运行 - TFS Power Tools 2008 Powershell Snapin won't run in on 64-bit in Windows 2008 R2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM