title: Error while moving List Items into folders -Exception calling "UpdateOverwriteVersion" with 0 argument(s)
body: <p>I am writing a PowerShell script to move List items into folders. The code is almost complete except for one problem. Every time it throws same exception for every item "<strong>System.Management.Automation.MethodInvocationException: Exception calling "Up
  dateOverwriteVersion" with "0" argument(s): Cannot open "Shared Documents/Document.ppt.zip": no such
   file or folder.</strong>" It doesn't throw this error if the folder already exists. My code is fairly simple. I am retrieving the year and month of the item's created by date then I am creating the year and month folder(inside year folder) using below code :</p>
  
  <pre><code>$yrfolder = $list.AddItem($list.RootFolder.url,[Microsoft.SharePoint.SPFileSystemObjectType]::Folder,$year)
      $yrfolder["Title"] = $year
      $yrfolder["Modified"] = "12/31/$year 00:00:00 AM"
      $yrfolder["Created"] = "12/31/$year 00:00:00 AM"
      $yrfolder["Editor"] = $yrfolder["Author"]        
      $yrfolder.Update()
  </code></pre>
  
  <p>Similarly I am creating the month folder inside the year folder and then moving the item inside it like this :</p>
  
  <pre><code>$moveToPath = $web.Url+"/"+$monthfolder.Url
  $moveToPath += "/" + $item.ID
  $web.GetFile($item.Url).MoveTo($moveToPath)
  $item["Modified"] = $modified #replacing the original value of item metadata 
  $item["Editor"] = $editor
  $item["Modified By"] = $editor
  $item.UpdateOverwriteVersion() # throws error here
  </code></pre>
  
  <p>But this same code worked on one of the sites where I moved 5000 items successfully. But now it's not. Need Help to debug this.</p>