0

I am using below script to create a folder:

$folder = $dList.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder)
    $folder["Title"] = "Test"
    $folder.Update();

Error: Invalid item data - missing fileref

1 Answer 1

2

Try this PowerShell to get rid of missing FileRef issue:

$web = Get-SPWeb -Identity http://aissp2013/sites/Team
$dList = $web.Lists["Doc2"]
$folder = $dList.AddItem($dList.RootFolder.ServerRelativeUrl, [Microsoft.SharePoint.SPFileSystemObjectType]::Folder, "Folder2")
$folder["Title"] = "Test"
$folder.Update()

This will create a folder with Name "Folder2" and Title as "Test"

1
  • 1
    I wish I would get lessons from you on powershell.. :)
    – Aquarius24
    Jan 29, 2015 at 7:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.