Delete All Versions - difference between Item and File methods

Aug 2, 2010 at 11:38 AM

Hi there,

Are you aware of any possible problems when using SPFileVersionCollection.DeleteAll Method?

The MSDN documentation states that this deletes ALL VERSIONS, whereas the SPListItemVersionCollection.DeleteAll Method states "Deletes the collection of versions except for the current version."

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splistitemversioncollection.deleteall.aspx

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfileversioncollection.deleteall.aspx

The documentation is sparse on MSDN.  If you use the List Item DeleteAll method your item versions will be removed, but if you inspect its related File versions, they are all still there.

I wrote a powershell script that identifies versions and also have a purge function like yours: when i run it the Item versions drops to ONE, however, the File versions drops to ZERO - which is not what I would expect.

 

Your thoughts on this would be most welcome!

 

Cheers,

Ben