1

I have a web part where a user adds a comment into a multi-line text field. It was originally set up as a rich-text field but I need to change it to plain-text for reasons. When I did so, all the comments added < div> or < p> to the comment and I need to mass remove this using power shell, to save me individually needing to edit thousands of comments. can this be done? example of div in comments

For reference, this is SharePoint 2010

  • Can you use regex or something like replace function in powershell? – Ganesh Sanap Jun 11 at 3:19
1

Try below code in your powershell script to strip off the html:

$string = <your rich text column>

$string -replace '<[^>]+>',''

If it is not working for you then try another solution given in below article:

HTML to Text conversion in Powershell

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.