此计算机上未安装 Windows PowerShell 管理单元“Microsoft.Sharepoint.Powershell"? [英] Windows PowerShell snap-in 'Microsoft.Sharepoint.Powershell' is not installed on this computer?

查看:199
本文介绍了此计算机上未安装 Windows PowerShell 管理单元“Microsoft.Sharepoint.Powershell"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是使用 powershell 的新手,我已经尝试解决这个问题好几个小时了,但仍然无法正常工作.

I am new in using powershell, I have been trying to solve this problem for hours and I cant still make it work.

先决条件:

  • 使用 Windows 10
  • 以管理员身份运行 Powershell ISE

但是当我使用Add-PSSnapin WebAdministration"

我试图运行的命令:

Add-PSSnapin Microsoft.Sharepoint.Powershell
$siteURL = Get-SPOSite "site"
$sitelists = foreach ($web in $siteURL.AllWebs) {
foreach($list in $web.lists){ $list } }
$sitelists |select * | Export-CSV C:\liststitles.csv

它显示以下错误:

PS C:\windows\system32> Add-PSSnapin Microsoft.Sharepoint.Powershell
Add-PSSnapin : The Windows PowerShell snap-in 'Microsoft.Sharepoint.Powershell' is not installed on this computer.
At line:1 char:1
+ Add-PSSnapin Microsoft.Sharepoint.Powershell
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (Microsoft.Sharepoint.Powershell:String) [Add-PSSnapin], PSArgumentEx 
   ception
    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand

我也下载了iis7psprov_x64.msi",但我不知道如何安装它,因为我无法以管理员身份运行它.而且我也读过,它应该在WebAdminstration"模块中可用.尝试运行文件时提示以下错误:

I also downloaded the "iis7psprov_x64.msi", but I don't know how to install it since I cant run it as administrator. and also I have read that, it should be available in the "WebAdminstration" module. When trying to run the file the following error is prompted:

可能与此类似,但对于 Windows 10:

Might be simmlar to this but for windows 10:

Windows7 中添加-PsSnapin WebAdministration

推荐答案

要在线使用 SharePoint,您需要 SharePoint Online Management Shell PowerShell 模块.安装后(在您的 Windows 10 机器上),PowerShell 将自动加载您需要的命令(如 Get-SPOSite),而无需手动导入模块.

To work with SharePoint online, you need the SharePoint Online Management Shell PowerShell module. Once installed (on your Windows 10 machine), PowerShell will automatically load the commands you need (like Get-SPOSite) without needing to import the module manually.

你可以从上面的链接下载,介绍在这里:https://docs.microsoft.com/en-us/powershell/sharepoint/sharepoint-online/introduction-sharepoint-online-management-shell?view=sharepoint-ps&redirectedfrom=MSDN

You can download it from the link above, and an introduction is here: https://docs.microsoft.com/en-us/powershell/sharepoint/sharepoint-online/introduction-sharepoint-online-management-shell?view=sharepoint-ps&redirectedfrom=MSDN

这篇关于此计算机上未安装 Windows PowerShell 管理单元“Microsoft.Sharepoint.Powershell"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆