当我尝试 GetList 时,出现以下异常:
Exception calling "GetList" with "1" argument(s): "<nativehr>0x80070002</nativehr><nativestack></nativestack>"
At C:\Scripts\teaCvProfileUpdate\uploadTeaCvsToSharepoint.ps1:37 char:36
+ $cvDocumentLibrary = $spWeb.GetList <<<< ("/people/User Resumes/Forms/")
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
这些是相关的 3 行代码(powershell):
$spSite = Get-SPSite $mySiteUrl
$spWeb = $spSite.OpenWeb("/")
$cvDocumentLibrary = $spWeb.GetList("/people/User Resumes/Forms/")
有人可以告诉我为什么会发生这种情况吗?
谢谢。 :)
最佳答案
尝试:
$spSite = Get-SPSite $mySiteUrl
$spWeb = $spSite.OpenWeb("people")
$cvDocumentLibrary = $spWeb.GetList("/people/User Resumes")
关于powershell - 使用 "GetList"参数调用 "1"时出现异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9197596/