I have a script where I locate a document library and try to add a folder to it, however, it fails. This is my current failing script:
$web = Get-SPWeb($completeUrl) $DocumentLibrary = $completeUrl + "/DocumentLibrary" $site = New-Object Microsoft.SharePoint.SPSite($DocumentLibrary) $website = $site.OpenWeb() $list = $website.GetList($DocumentLibrary) $newFolder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder) $newFolder["Title"] = "Weekly" $newFolder.Update()
The exception that I get is:
Exception calling "Update" with "0" argument(s): "Invalid item data -- missing FileRef."