Last active
February 24, 2017 16:28
-
-
Save jcallaghan/17996432f3bd62e602ed96679c55bc9f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$wpManager = $file.GetLimitedWebPartManager([Microsoft.SharePoint.Client.WebParts.PersonalizationScope]::Shared) | |
$webparts = $wpManager.Webparts | |
$clientContext.Load($webparts) | |
$clientContext.ExecuteQuery() | |
if($webparts.Count -gt 0){ | |
Write-Host "Looping through all webparts" | |
foreach($webpart in $webparts){ | |
$clientContext.Load($webpart.WebPart.Properties) | |
$clientContext.ExecuteQuery() | |
$properties = $webpart.WebPart.Properties.FieldValues | |
Write-Host "Title: " $properties["Title"] | |
Write-Host "Chrome: " $properties["ChromeType"] | |
$webpart.WebPart.Properties["ChromeType"] = 2 # 0 title and boarder, 1 title, 2 none | |
$webpart.SaveWebPartChanges() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment