Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am using a powershell script to retrieve the user profile information (i.e., about me, skills...)

$usp["sps-skills"].tostring()

It is getting the required information however the data also contains the unwanted HTML components (i.e, <p>,<div>...).

I want to escape the HTML components, what would be the best way of doing it.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

You can use the -replace parameter in Powershell, which works like Regex.Replace() in .NET.

$usp["sps-skills"].tostring() -replace "<(.|\n)*?>",""

matches 0 or more occurrances of any character or new line in between < and >

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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