0

Below this code was not working

 Write-Host "Total Number version for this item: " $fieldName -ForegroundColor Blue for ($i = 0; $i -lt $item.Versions.Count; $i++) { if ($item.Versions[$i][$fieldName] -ne $null) { $item.Versions.VersionId["Document Status"] = "Superseded"; $item.Versions[$i].SystemUpdate(); } } 

1 Answer 1

0

No. There is no straight forward api/method for that. A complex and somewhat riskier method will be to remove newer versions modify value and then add newer versions again.

On same lines, one may create a new list to store all items and versions there, empty original list and add items with versions with changes as required.

Unless it is very very business critical, build logic to accept both "Document Status" values with some additional logic e.g. if "Modified" is less than <date of logic change> and "Document Status" is "<something>" or "Modified" is more than or equals <date of logic change> and "Document Status" is "<something>" then ...

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.