Windows PowerShell snap-in 'Microsoft.Sharepoint.Powershell' is not installed on this computer?

时光总嘲笑我的痴心妄想 提交于 2019-12-10 12:24:41

问题


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

Prerequisites:

  • Using windows 10
  • Running the Powershell ISE as Administrator

But when I used the "Add-PSSnapin WebAdministration"

Command that I am trying to run:

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

It shows the following error:

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

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:

Might be simmlar to this but for windows 10:

Add-PsSnapin WebAdministration in Windows7


回答1:


To work with SharePoint online, you need the SharePoint Online Management Shell. 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.

You can download it from the link above, and an introduction is here: https://technet.microsoft.com/en-us/library/fp161388.aspx



来源:https://stackoverflow.com/questions/43997587/windows-powershell-snap-in-microsoft-sharepoint-powershell-is-not-installed-on

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!