我是使用PowerShell的新手,我一直在努力解決這個問題幾個小時,我不能使它的工作。此電腦上未安裝Windows PowerShell管理單元'Microsoft.Sharepoint.Powershell'?
先決條件:
- 採用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」模塊中可用。當試圖運行該文件會被提示以下錯誤:
可能simmlar到這一點,但對於Windows 10:
Add-PsSnapin WebAdministration in Windows7
對於這個問題引用'Microsoft.SharePoint.Powershell'標題。你的代碼示例說'Add-PSSnapin WebAdministration',你的錯誤信息再次引用SharePoint。請你能澄清你想要做什麼?你需要運行哪些命令?與SharePoint相關的命令不是Web管理模塊的一部分(據我所知)。 – Robin
@Robin分享點相關命令...對於混淆抱歉。在搜索答案時,我偶然發現了Web管理模塊,因此我認爲這是錯誤 – SCS
Web管理是針對Microsoft IIS的。您是否嘗試在Office 365中使用SharePoint?或本地? – Robin