[英]PSSnapin Microsoft.Sharepoint.Powershell is not installed on this computer
When I try to run the command Add-PSSnapin Microsoft.SharePoint.Powershell
in SharePoint Online Management Shell 当我尝试在SharePoint Online Management Shell中运行Add-PSSnapin Microsoft.SharePoint.Powershell
命令时
I get the following error: 我收到以下错误:
Add-PSSnapin : The Windows PowerShell snap-in 'Microsoft.SharePoint.Powershell` is not installed on this computer
+ CategoryInfo: InvalidArgument: (Microsoft.SharePoint.Powershell:string) [Add-PSSnapin], PSArgumentException
From what I understand this is supposed to come installed with SharePoint Online Management Shell anyway (this is a fresh download) so why won't it let me install it 根据我的理解,无论如何都应该安装SharePoint Online Management Shell(这是一个全新的下载)所以为什么它不能让我安装它
I can login to Sharepoint using the $AdminURL, $AdminName & $Password so it's not the end of the world (and proves that this should work), but obviously makes the script less easy to run across sites as it has to be modified everytime to change the url and adminname 我可以使用$ AdminURL,$ AdminName和$ Password登录Sharepoint,因此它不是世界末日(并证明这应该可行),但显然使脚本不易跨站点运行,因为每次都必须修改它更改网址和管理员名称
EDIT: I read on another post that adding this module (not snapin) would fix my issue of the error Get-SPSite is not recognized as the name of a cmdlet, function, script file, or operable program
and Get-SPWebApplication is not recognized as the name of a cmdlet, function, script file, or operable program
However, this did not fix my problem... 编辑:我在另一篇文章中读到,添加此模块(不是snapin)将解决我的错误问题Get-SPSite is not recognized as the name of a cmdlet, function, script file, or operable program
Get-SPWebApplication is not recognized as the name of a cmdlet, function, script file, or operable program
然而,这并没有解决我的问题...
As mentioned by user @kuzimoto the commands I was using were not compatible with SharePoint Online and were designed to be used in conjunction with SharePoint Server. 正如用户@kuzimoto所提到的,我使用的命令与SharePoint Online不兼容,并且旨在与SharePoint Server结合使用。
The correct way to connect is using the command Connect-SPOService
and passing through the credentials through there or just have them hard coded into your script. 正确的连接方式是使用Connect-SPOService
命令并通过那里传递凭据,或者将它们硬编码到您的脚本中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.