Sign up ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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"

share|improve this answer
1  
I wish I would get lessons from you on powershell.. :) –  Aquarius24 Jan 29 at 7:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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