Open bclevering opened 7 years ago
Hi Bert,
Can you give me an example on how you use the cmdlet and what the expected outcome is? You mean you set a property through powershell and when you navigate to the page with the webpart the property is not set? If so, what property are you trying to set?
@erwinvanhunen - Same problem here. I'm using SharePoint Online and December Release of PnP PowerShell
This is what I'm trying to do:
$wp = Get-PnPWebPart -ServerRelativePageUrl "/sites/TEST/Lists/Projects/NewForm.aspx"
Set-PnPFileCheckedOut -Url "/sites/TEST/Lists/Projects/NewForm.aspx"
Set-PnPWebPartProperty -ServerRelativePageUrl "/sites/TEST/Lists/Projects/NewForm.aspx" -Identity $wp.Id -Key "JSLink" -Value "~sitecollection/Style Library/jquery-3.0.0.min.js|~sitecollection/Style Library/TEST.js"
Set-PnPFileCheckedIn -Url "/sites/TEST/Lists/Projects/NewForm.aspx"
I think I get the correct ID for the webpart and if I try to not write "JSLink" as key but sth. that does not exist, I also get a proper error message like "The DUMMY property does not exist."
For "JSLink" it does not return such an error message, but when I reload the NewForm.aspx and search the source code, I cannot find my custom JS file.
as @cheindel also commented it's (almost) every property i'm trying to set
@bclevering @cheindel Hi, I tested this and it works on SharePoint 2013 with 2.13.1703.0. Please note that Get-PnPWebPart is getting a collection of WebParts if there are more webparts on your page.
I have the same problem, when I set a webpart property it's correctly filled, but the value of the property isn´t applied. The property is applied, only when I manually click on the apply button of the webpart. Do you have a command to publish the changes? Thanks
Which version of the PnP-PowerShell Cmdlets are you using?
What is the version of the Cmdlet module you are running?
2.9.1611.0
How did you install the PnP-PowerShell Cmdlets?
When executing Set-PnPWebPartProperty the new property isn't published.
What additional steps do i need to take to publish the new webpart property?