pnp / powershell

PnP PowerShell
https://pnp.github.io/powershell
MIT License
679 stars 347 forks source link

[BUG] A paragraph is adding in Text web part when other web part is updated using Set-PnPClientSideWebPart #698

Closed jmunozcastro closed 3 years ago

jmunozcastro commented 3 years ago

Reporting an Issue or Missing Feature

When a PowerShell script is run to update a property of any web part using Set-PnPClientSideWebPart Cmdlet, a paragraph is added at the beginning and a paragraph at the end in all Text web parts that exist on the same page, as long as they start with a title , that is, its first line is of type "Heading 1" or "Heading 2" or "Heading 3".

Expected behavior

Just update the web part specified in the parameter of the Set-PnPClientSideWebPart Cmdlet without any effect on the Text web parts.

Actual behavior

In all Text web elements whose first line is a title after the update of another web part, a paragraph is added before and at the end

Steps to reproduce behavior

The following piece of code shows the update of the description property of a Highligted content web part that affects the Test web parts found on the same page:

image

Note: it does not matter which web part is updated, if there are Text web parts on the same page, they are affected

The following image shows an affected Text web part image

Which version of the PnP-PowerShell Cmdlets are you using?

What is the version of the Cmdlet module you are running?

Version: 5.1.18362.1474

Which operating system/environment are you running PnP PowerShell on?

veronicageek commented 3 years ago

@jmunozcastro - Which version of PnP.PowerShell are you using? This is different from from the PowerShell version (5.1 you're mentioning). You can get with Get-Module PnP.PowerShell -ListAvailable

jmunozcastro commented 3 years ago

@veronicageek Thanks in advance for the help, but when I run that command I don't retrieve any version, I guess that I installed as Install-Module SharePointPnPPowerShellOnline and after that, I ran the following command Update-Module SharePointPnPPowerShell* and according with your page is a Legacy version

veronicageek commented 3 years ago

@jmunozcastro - In that case you're using the old SharePointPnPPowerShellOnline module which is not maintained anymore.

Please use the new PnP.PowerShell module (this repo), and try your cmdlet. Have a look at the documentation to help you get started with this module.

jmunozcastro commented 3 years ago

Yep that was the problem, using the PnP.PowerShell version 1.5.0, the issue is not anymore. Thank you!