I want to add a date based on item created date +2 years for all existing items in the New Column Date , can any one help on this using PowerShell?


Created date: 7/9/2015
Date:         7/9/2017

Here you go:

$spWeb = Get-SPWeb -Identity http://<sitecollection>/<subsite>
$spItems = $lList.GetItems()
foreach($spItem in $spItems)
    $spItem["Date"] = $spItem["Created"].AddYears(2)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.