【问题标题】:Error when adding SharePoint Powershell snapin添加 SharePoint Powershell 管理单元时出错
【发布时间】:2015-02-04 06:08:53
【问题描述】:

当我运行 Add-PSSnapin microsoft.sharepoint.powershell 时,我得到了

Add-PSSnapin : No snap-ins have been registered for Windows PowerShell version 3. At line:1 char:1 + Add-PSSnapin microsoft.sharepoint.powershell + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (microsoft.sharepoint.powershell:String) [Add-PSSnapin], PSArgumentException + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand

我知道这听起来很愚蠢,但我已经在 Google 上搜索了大约 12 个小时,试图添加这个管理单元。我正在编写我的第一个 shell 脚本,只需要帮助开始

【问题讨论】:

  • 我很确定您需要 sharepoint 安装媒体来安装 powershell 部件。
  • 您可以使用Get-PSSnapin -Registered在系统上找到所有可用的管理单元
  • 请问有人找到解决方案了吗?我仍然无法使用 Invoke-SQlcmd :(
  • 每个 Hunter 的回答 - 您必须在安装了共享点的实际服务器上运行 power shell。

标签: powershell sharepoint


【解决方案1】:

您的 SharePoint 版本是 2010 还是 2013?
你的 Powershell 版本是什么? ($PSVersionTable.PSVersion)

SharePoint 2010 需要 PowerShell 版本 2,您可以通过运行 powershell -version 2 来获得它

注意。 (致上面的评论者)
如果您没有在 PC 上安装 SharePoint,则会收到此消息。

Add-PSSnapin : The Windows PowerShell snap-in 'Microsoft.SharePoint.PowerShell' is not installed on this machine.
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

【讨论】:

  • 我正在使用 sharepoint 2010 运行 powershell 版本 3。我可以在客户端上以某种方式安装 sharepoint 吗?
  • SharePoint 2010 仅与 PowerShell v2 兼容,您可以按照上面的屏幕截图进行访问和使用。要同时使用 SharePoint 2010 和 powershell 命令,您需要在该计算机上安装 SharePoint。
【解决方案2】:

根据您的问题,我可以理解您使用的是 powershell 3.0 版。 请重新启动您的系统,然后尝试添加管理单元。它应该适合您。

【讨论】:

  • PS > Add-PSSnapin Microsoft.SharePoint.PowerShell Add-PSSnapin:此计算机上未安装 Windows PowerShell 管理单元“Microsoft.SharePoint.PowerShell”。在 line:1 char:1 + Add-PSSnapin Microsoft.SharePoint.PowerShell + ~~~~~ + CategoryInfo : InvalidArgument: (Microsoft.SharePoint.PowerShell:String) [Add-PSSnapin], PSArgumentException + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft。 PowerShell.Commands.AddPSSnapinCommand PS> $PSVersionTable.PSVersion Major Minor Build Revision ----- ----- ----- -------- 5 1 18362 752
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-05-15
  • 2013-07-16
  • 1970-01-01
  • 2015-03-21
  • 2014-01-23
相关资源
最近更新 更多