0

I have a list which contain the built-in Description field (internal name = comment) which is if type "Rich Text",now i have created a new site column of type "Enhanced Rich Text" named "Custom Description". so i want to copy the content of the current "Description" field which is of type "Rich Text", to be inside the new site column which is of type Enhanced Rich text. and i do not want to change any of these values:-

  1. modified.
  2. modified by
  3. Version

so i wrote this power-shell script :-

$spWeb = Get-SPWeb -Identity "http://****/site/siteA"
$spList = $spWeb.Lists["Tracking"]
$spItem = $spList.GetItemById(6) //will do this for all the fields
$spItem["Custom Description"] = $spItem["Comment"]
$spItem.SystemUpdate()

now using this power-shell script i was able to copy the content of the built-in column "Comment" inside the "Custom Description" and the modified, modifiedby & version did not change... so seems it will achieve what i am looking for

now since i am going to use this power-shell script on all my list items,, so can anyone advice if the above power-shell script can cause any problem i am not aware of?? or it will simply modify the item field safely ?

  • 1
    That should do it. – mannaggia Apr 20 '17 at 21:04
2

The SystemUpdate() method is indeed what you are looking for. This method will update the item without changing the Modified, Modified By, and Version fields.

Your PowerShell script will do exactly what you think it is doing, so you can use it without worries.

References:

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.