Skip to content

Add Assessment-driven page wave scripts - #676

Draft
TaoziZ03 wants to merge 3 commits into
pnp:devfrom
TaoziZ03:titao/assessment-page-wave-scripts
Draft

Add Assessment-driven page wave scripts#676
TaoziZ03 wants to merge 3 commits into
pnp:devfrom
TaoziZ03:titao/assessment-page-wave-scripts

Conversation

@TaoziZ03

@TaoziZ03 TaoziZ03 commented Jul 27, 2026

Copy link
Copy Markdown

Summary

  • Add an Assessment-driven script that transforms every approved representative Wiki/Web Part page.
  • Add a second script that expands to all user-specified pages only after every representative page is validated as passed.
  • Support interactive, device-login, certificate-thumbprint, and certificate-file authentication.
  • Share source validation, transformation, logging, and result persistence through one common implementation.
  • Add inline comments for each safety phase and a repeatable Pester test suite.

Companion documentation PR: SharePoint/sp-dev-docs#10964

Representative-page flow

Convert-RepresentativePages.ps1:

  • Requires at least one Selected=true page for every IncludePattern=true pattern.
  • Requires expected visible content and a validation owner.
  • Supports -WhatIf, High-impact confirmation, and unattended certificate authentication.
  • Creates draft pages without overwrite or source renaming.
  • Writes each result immediately with ValidationStatus=Pending.

Wave expansion gate

Convert-SelectedPages.ps1 refuses to run unless:

  • The original representative manifest and result set match one-to-one.
  • Every result matches the current manifest SHA-256.
  • Every representative has TransformationStatus=Created and ValidationStatus=Passed.
  • The current PnP PowerShell version and Web Part mapping match the representative profile.
  • Every additional page belongs to a pattern with a passed representative.

Safety

Both scripts:

  • Require PowerShell 7.4.0 or later.
  • Resolve the assessed list by GUID.
  • Verify list URL, file URL, item parent list, and source modification time.
  • Recheck the current web home page immediately before conversion.
  • Bind ConvertTo-PnPPage by exact list item ID.
  • Create drafts with -DontPublish.
  • Don't use -Overwrite or -TakeSourcePageName.
  • Persist every result row immediately and refuse result-file clobber without -Force.
  • Cache connections and authentication failures.

The first version intentionally rejects:

  • Publishing and Blog pages.
  • Web-root pages and pages outside the default SitePages library.
  • Home pages.
  • Zero-part pages.
  • Pages with item-level unique permissions.
  • Unmapped pages without an explicit custom mapping file.

These cases require separately reviewed transformation paths.

Validation performed

  • Pester: 7 passed, 0 failed.
  • PowerShell AST parsing for all scripts.
  • -WhatIf representative and expanded-wave runs against manifests derived from a 423-page Assessment.
  • Mock full execution for both entry scripts.
  • Interactive, certificate-thumbprint, and certificate-file branches.
  • Result persistence and clobber protection.
  • Representative validation, manifest hash, transformation profile, and unrepresented-pattern gates.
  • Source modification, list identity, current-home-page, and unique-permission safety gates.

This PR is intentionally a draft for script-owner review.

titao added 2 commits July 27, 2026 19:40
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: a7db0d98-be53-48c2-9488-9a226f457144
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: a7db0d98-be53-48c2-9488-9a226f457144
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: a7db0d98-be53-48c2-9488-9a226f457144
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant