问题
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