jjzjj

.net - Microsoft.SharePoint.PowerShell Snapin : Incorrect Windows PowerShell version 3. 0. 当前控制台支持 Window PowerShell 版本 2.0

coder 2024-06-13 原文

我的机器上有 SharePoint 2010,用于开发目的,我错误地升级到 .Net 4.0 和 PowerShell 3.0。

解决方法是,使用 -version 2.0 或 -v 2 开关/参数运行 powershell 并不完全有效。

那么,这个问题是如何在具有 .Net 4.0 框架的计算机上的 Powershell 中添加 Microsoft.Sharepoint.PowerShell 管理单元?

尝试 1:

PS> Add-PSSnapin Microsoft.Sharepoint.Powershell
The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered.
PS>  Get-SPSite('http://myServerName/')
Get-SPSite : Microsoft SharePoint is not supported with version 4.0.30319.18052 of the Microsoft .Net Runtime.

好的,所以我尝试 2:

PS> powershell.exe -version 2.0
PS> Add-PSSnapin Microsoft.Sharepoint.Powershell
Add-PSSnapin : Incorrect Windows PowerShell version 3.0. Windows PowerShell version 2.0 is supported in the current console.
At line:1 char:13
+ Add-PSSnapin <<<<  Microsoft.Sharepoint.PowerShell
    + CategoryInfo          : InvalidArgument: (Microsoft.Sharepoint.PowerShell:String) [Add-PSSnapin], PSArgumentException
    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand

我也试过设置快捷方式的目标。 并卸载以q结尾的windows更新

所以,这就是我的错误,我无法找到以下方面的任何信息: 不正确的 Windows PowerShell 版本 3.0。当前控制台支持 Windows PowerShell 2.0 版。

有什么想法吗?

最佳答案

在最近的 SharePoint 2010 更新之后,我能够添加 powershell 管理单元,同时在 2.0 版中运行 powershell

关于.net - Microsoft.SharePoint.PowerShell Snapin : Incorrect Windows PowerShell version 3. 0. 当前控制台支持 Window PowerShell 版本 2.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18291402/

有关.net - Microsoft.SharePoint.PowerShell Snapin : Incorrect Windows PowerShell version 3. 0. 当前控制台支持 Window PowerShell 版本 2.0的更多相关文章

随机推荐