0

I want to move my pages library items to any collection e.g, Arraylist or any other collection, Is that possible?

i want to do this because i want to delete and add again same CT (that pages library items are using ) from Pages Library, for this i want to temporary move all items to any collection and after performing delete/Add CT action from library, I will add all the items back to library from collection. Is that possible?

Or I Need any other Idea/suggestion to perform this ?

  • you want to move them in different list or different site collection? – Waqas Sarwar MVP Feb 23 '16 at 12:16
  • I just want to move all items in any collection in my powershell script within same site – SPBeginer Feb 23 '16 at 12:50
0

You can try this one

$web = "http://dev/re/ad/wf/"

$orgLibrary = (Get-SPWeb $web).Folders["Approval History - Centre EV"]
$destLibrary = (Get-SPWeb $web).Folders["Approval History - Centre EV1"]

$destFiles = $destLibrary.Files
foreach ($file in $orgLibrary.Files)
{
    $curFile = $file.OpenBinary()
    $destURL = $destFiles.Folder.Url + "/" + $file.Name
    $destFiles.Add($destURL, $curFile, $true)
} 

http://blog.isaacblum.com/2011/10/04/spfilecollection-class-copy-files-to-another-document-library/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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