powershell - 使用 "GetList"参数调用 "1"时出现异常

标签 powershell sharepoint-2010

当我尝试 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/

相关文章:

powershell - VSCode powershell函数签名智能感知建议

azure - 如何从 Azure PowerShell 为用户请求 Azure Graph API 访问 token ?

c# - 在来自共享点的客户端对象模型上使用 Linq

Powershell:如何使用 invoke-command 和 -filepath 远程传递参数?

powershell - Get-WinEvent 搜索所有错误

Azure Powershell 新-AzADUser : A parameter cannot be found that matches parameter name 'MobilePhone'

java - 无法使用 java 上传共享点文件夹上的文档

c# - Sharepoint 2010、ClientContext 和 401 未经授权

c# - MailMessage.To.Add() 抛出异常 : "An invalid character was found in the mail header: ' ,'."

sharepoint - 以编程方式删除Web.config设置