The following example deletes the version history for items based on the criteria.



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);