这是我的文档库的样子。我的文档库有 2 种内容类型。一种内容类型基于文档,另一种内容类型基于“链接到文档”类型。
我正在尝试使用 powershell 脚本上传一些文件。我正在使用 csv 文件逐行读取并将文件上传到文档库。我在 $i.fileNameASPX 上遇到错误。Powershell 告诉我 , 之后缺少表达式。那么该怎么办。
if($i.ContentType = "LegalLink2Document")
{
$itemType = $docLibrary.ContentTypes[$i.ContentType]
$newFile = $docLibrary.RootFolder.Files.Add($i.fileNameASPX, UTF8Encoding.UTF8.GetBytes(builder.ToString()), $true)
$theItem = $newFile.Item
$theItem["ContentTypeId"] = $itemType.Id
$itemUrl = ew-object Microsoft.SharePoint.SPFieldUrlValue()
$itemUrl.Url = $i.fileLinkUrl
$itemUrl.Descrition = $i.URLDESC
$theItem["URL"] = $itemUrl
}