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

标签 .net windows sharepoint-2010 powershell-2.0 powershell-3.0

我的机器上有 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/

相关文章:

c# - 使用 token 结帐费用

c# - 在具有 32 个以上逻辑内核的系统上使用 Process.ProcessorAffinity

windows - 设置 grep 行尾字符

linux - 为多个 GPU 编写 CUDA 程序

SharePoint 2010 REST API JQUery 插入、更新、删除

c# - 检查是否连接到 Wi-Fi 网络 C#

python - 使python进程名称更明确

sharepoint - 禁用特定文件夹 sharepoint 2010 中的版本控制

security - 从文档库打开时,SharePoint 2010 强制我保存 PDF

c# - 这是 MCTS 自定进度培训套件(考试 70-536)中的错误吗?