powershell icon indicating copy to clipboard operation
powershell copied to clipboard

[FEATURE] When calling publish or save, there is an issue with GUIDs showing in search

Open westleyMS opened this issue 3 years ago • 2 comments

Reporting an Issue or Missing Feature

We are trying to re-save a bunch of pages but the web part GUIDs end up in the search results.

We use Set-PnPClientSidePage to change the description of a page that has the GUID in the search results problem.

Expected behavior

The search result for that page stops showing web part GUIDS.

Actual behavior

The web part GUIDs still show in the search results.

Steps to reproduce behavior

The problem that caused the GUIDs to show has been fixed, but the data in the file still has the issue.

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

PnP.PowerShell 1.8.0

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

  • [X] Windows
  • [ ] Linux
  • [ ] MacOS
  • [ ] Azure Cloud Shell
  • [ ] Azure Functions
  • [ ] Other : please specify

We have a workaround with the M365 CLI but some customers are not able to use that in their environment. m365 spo page set --name page.aspx --webUrl https://contoso.sharepoint.com/sites/a-team --description "Description to add for the page"

This CLI call will result in REST calls to - /pages(x)/SavePage /pages(x)/SavePageAsDraft

Then this call to publish will publish the new version- m365 spo page set --name page.aspx --webUrl https://contoso.sharepoint.com/sites/a-team --publish

It does remove the GUIDs from the pages search results. The M365 CLI does call these endpoints and if we could get the PnP Powershell module to behave the same, it would resolve this issue for our customer since they can't use the CLI in their environment.

westleyMS avatar Sep 20 '22 20:09 westleyMS

@westleyMS - Can you please first update the module as you're using 1.8.0 and we're at 1.11.0 (major) or even a nightly release if you can. Thanks.

veronicageek avatar Sep 21 '22 20:09 veronicageek

I did, but it will not change the issue. The source code shows that it is not using the one endpoint that works (savePageAsDraft). If that endpoint is not called, it will not work.

I have tried the published endpoints directly using REST and CSOM.

westleyMS avatar Sep 22 '22 19:09 westleyMS