Skip to content

Issue with SPO Modern Page URL Report #516

@danelson276

Description

@danelson276

I'm attempting to use the https://github.com/pnp/script-samples/tree/main/scripts/spo-modern-page-url-report. I've copied the code and using it without changes. The code works up until listing the links and URLs associated with the Quick Link web parts. The code identifies the pages, identifies the Quick Link web parts, but doesn't return the name of the web part nor does it return the items and links associated with the items. Screen shot below:
image

I've narrowed the issue to this section of code:
$summaryLinks | Foreach-Object{

        $wpTitle = $_.title
        Write-Host "Web Part Title: $($wpTitle)"

        $serverContent = $_.ServerProcessedContent | ConvertFrom-Json
		$itemCount = $serverContent.links.Count
		
        #{htmlStrings, searchablePlainTexts, imageSources, links...}
        Write-Host "Item Count: $($itemCount)"

I believe the ConvertFrom-Json is not returning the expected values - $serverContent has no values after the cmdlet ConvertFrom-Json:
serverContent: @{htmlStrings=; searchablePlainTexts=; imageSources=; links=; componentDependencies=; customMetadata=}

If I comment out the ConvertFrom-Json, the $serverContent returns the following for one Quick Link Web part:
{"htmlStrings":{},"searchablePlainTexts":{"title":"QL Number one","items[0].title":"Another Test Link","items[1].title":"This site's home page"},"i
mageSources":{"items[0].rawPreviewImageUrl":"/sites/3rdTestTeamSiteforTemplateTest/_api/v2.1/sites/[domainremoved].sharepoint.com,e16f023a-947e-4cdd-be6a-6b127
c3ef342,ca72a879-b211-4ae7-989b-b166af612621/items/9c034063-74bd-4f19-a936-8534bff05257/driveItem/thumbnails/0/c400x99999/content?preferNoRedirect=true"},"links":{
"baseUrl":"https://[domainremoved].sharepoint.com/sites/3rdTestTeamSiteforTemplateTest","items[0].sourceItem.url":"/sites/3rdTestTeamSiteforTemplateTest","item
s[1].sourceItem.url":"/sites/3rdTestTeamSiteforTemplateTest/SitePages/Home.aspx"},"componentDependencies":{"layoutComponentId":"706e33c8-af37-4e7b-9d22-6e5694d92a6
f"},"customMetadata":{"items[0].rawPreviewImageUrl":{"fixedWidth":100,"minCanvasWidth":32767}}}

Any help would be greatly appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions