Here is my document library looks like. I have 2 content types with my document library. 1 content type is based on Document and the other content type is based on "Link to a document" type.
I am trying to upload some files using powershell script. I am using a csv file to read line by line and upload files to document library. I am getting error on $i.fileNameASPX. Powershell tells me that Missing expression after , . So what to do.
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
}