Delete Previous Versions
The following example deletes the version history for items based on the criteria.
- Connect to the administration web service.
- Set the minimum date is the from which previous versions should be deleted.
- Setting the item type to 'Unknown' deletes previous versions for all item type.
- View the event log, or get previous versions storage information for information about the number of records deleted.
Code Sample
# Delete the previous versions that are older than 3 years, for all items.
$minimumDate = (Get-Date).AddYears(-3);
$administration.DO_DeletePreviousVersions('Unknown', $minimumDate);