I want to read the actual Content value (html source) from Content Editor web part using powershell or pnp powershell. Also, i want to read the web part properties PartOrder,TypeName.

<Content xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor"><![CDATA[<p>​<br/></p>Testing the content editor<br/><br/>]]></Content>


$SPweb = Get-SPWeb($completeUrl)

$wpMngr = $SPweb.GetLimitedWebPartManager("SitePages/testWebPart.aspx",[System.Web.UI.WebControls.Webparts.PersonalizationScope]::Shared); #you could change the page
foreach($wp in $wpMngr.WebParts)
Write-Host "TypeName" $wp
Write-Host "content" $wp.ContentLink                        
Write-Host "PartOrder" $wp.PartOrder
Write-Host "------------"

Test Result: enter image description here

  • Content link able to read.. But i want to read the content of the content editor web part((html source) – Liz Jun 15 '20 at 12:45
  • CDATA i want to add – Liz Jun 15 '20 at 13:15

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.