在Windows 10 PC中运行Sharepoint PowerScript时找不到类型[Microsoft.SharePoint.SPSite] [英] Cannot find type [Microsoft.SharePoint.SPSite] when running Sharepoint PowerScript in a Windows 10 PC
问题描述
您好
我想从LIST下载所有附件以进行本地备份。当我运行SP Powerscript时,第一个语句已经失败....
new-object:找不到类型[Microsoft.SharePoint。 SPSite]:验证是否加载了包含此类型的程序集。 ...。
在运行此脚本之前我需要安装什么?
提前致谢
似乎Assemblies未正确加载。[ 系统 。 反射 。 汇编 ] :: LoadFile ( " C:\ MOSSLibrary\Microsoft.SharePoint.Client.dll" ) | 输出 - 空
[ 系统 。 反射 。 汇编 ] :: LoadFile ( " C:\ MOSSLibrary \ Microsoft.SharePoint.Client.Runtime.dll" ) | 输出 - 空
而不是上面,请尝试以下添加 - 类型 - 路径 " C:\ MOSSLibrary \ Microsoft.SharePoint.Client.dll"
添加 - 类型 - 路径 " C:\ MOSSLibrary \ Microsoft.SharePoint.Client.Runtime.dll"
PS: 确保C:\ MOSSLibrary \
包含
以下两个.dll
'sMicrosoft 。 SharePoint 。 客户 。 dll
Microsoft 。 SharePoint 。 客户 。 运行时 。 DLL 跨度>
Hi
I want to download all attachments from a LIST for local backup purpose. When I run a SP Powerscript, the first statement already failed....
new-object : Cannot find type [Microsoft.SharePoint.SPSite]: verify the assembly containing this type is loaded. ….
Anything I need to install before I can run this script ??
Thanks in advance
It seems Assemblies are not loading correctly.
[System.Reflection.Assembly]::LoadFile ("C:\MOSSLibrary\Microsoft.SharePoint.Client.dll") | Out-Null [System.Reflection.Assembly]::LoadFile("C:\MOSSLibrary\Microsoft.SharePoint.Client.Runtime.dll") | Out-Null
Instead of above, try following
Add-Type -Path "C:\MOSSLibrary\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\MOSSLibrary\Microsoft.SharePoint.Client.Runtime.dll"
PS: Make sure that
C:\MOSSLibrary\
contains following two.dll
'sMicrosoft.SharePoint.Client.dll Microsoft.SharePoint.Client.Runtime.dll
这篇关于在Windows 10 PC中运行Sharepoint PowerScript时找不到类型[Microsoft.SharePoint.SPSite]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!