pnp / powershell

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

[BUG] - Set-PnPPageTextPart and Set-PnPClientSideText don't working to update text on pages #823

Closed WagnerJoseS closed 3 years ago

WagnerJoseS commented 3 years ago

Hi,

I hope I'm sending this problem to the right place :) I'm trying to change the texts in the text webparts and unfortunately it's not working for me or in Azure functions.

Connect-PnPOnline $siteURL -ClientId $clientId -ClientSecret $clientSecret $newPage = Get-PnPClientSidePage "$pageTitle.aspx" $textControls = $newPage.Controls | Where-Object {$_.Type.Name -eq "PageText"}

foreach ($textControl in $textControls){ Set-PnPPageTextPart -Page $newPage -InstanceId $textControl.InstanceId -Text "Any text" }

The error that shows

Set-PnPPageTextPart : CSOM service exception No linha:4 caractere:5

• Set-PnPPageTextPart -Page $newPage -InstanceId $textControl.Insta ...

~~~~~~~~~~~~~

• CategoryInfo : WriteError: (:) [Set-PnPPageTextPart], CsomServiceException

• FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.Pages.SetClientSideText

I also tried to use the command but it shows the following message Set-PnPClientSideText -Page $newPage -InstanceId $textControl.InstanceId -Text "Any text"

AVISO: Please use 'Set-PnPPageTextPart'. The alias 'Set-PnPClientSideText' will be removed in the 1.5.0 release Set-PnPClientSideText : CSOM service exception No linha:3 caractere:5

• Set-PnPClientSideText -Page $newPage -InstanceId $textControl.Ins ...

~~~~~~~~~~~~~

• CategoryInfo : WriteError: (:) [Set-PnPPageTextPart], CsomServiceException

• FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.Pages.SetClientSideText

How do I update the texts on a page?

[] Wagner José

Notice

Many bugs reported are actually related to the PnP Framework which is used behind the scenes. Consider carefully where to report an issue:

  1. Are you using Invoke-PnPSiteTemplate or Get-PnPSiteTemplate? The issue is most likely related to the Provisioning Engine. The Provisioning engine is not located in the PowerShell repo. Please report the issue here: https://github.com/pnp/pnpframework/issues.
  2. Is the issue related to the cmdlet itself, its parameters, the syntax, or do you suspect it is the code of the cmdlet that is causing the issue? Then please continue reporting the issue in this repo.
  3. If you think that the functionality might be related to the underlying libraries that the cmdlet is calling (We realize that might be difficult to determine), please first double check the code of the cmdlet, which can be found here: https://github.com/pnp/powershell/tree/master/src/Commands. If related to the cmdlet, continue reporting the issue here, otherwise report the issue at https://github.com/pnp/pnpframework/issues

Reporting an Issue or Missing Feature

Please confirm what it is that your reporting

Expected behavior

Please describe what output you expect to see from the PnP PowerShell Cmdlets

Actual behavior

Please describe what you see instead. Please provide samples of output or screenshots.

Steps to reproduce behavior

Please include complete script or code samples in-line or linked from gists

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

(you can retrieve this by executing Get-Module -Name "PnP.PowerShell" -ListAvailable)

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

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days