locked
Update Fields in the Existing Version History + Powershell Script RRS feed

  • Question

  •   Write-Host "Total Number version for this item: " $versions.Count  -ForegroundColor Blue
             $fieldName = $item.Fields["Document Status"]
               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();
                }
                }
    }


    raghuraj.raja@gmail.com

    Friday, March 31, 2017 1:51 PM