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.. :) Commented 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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.