Skip to content

Adds 'spo page unpublish' command. Closes #7540 - #7541

Open
Anikesh348 wants to merge 1 commit into
pnp:mainfrom
Anikesh348:feature/spo-page-unpublish
Open

Adds 'spo page unpublish' command. Closes #7540#7541
Anikesh348 wants to merge 1 commit into
pnp:mainfrom
Anikesh348:feature/spo-page-unpublish

Conversation

@Anikesh348

@Anikesh348 Anikesh348 commented Aug 13, 2026

Copy link
Copy Markdown

Closes #7540

Summary

  • add spo page unpublish for modern SharePoint pages
  • normalize page names, including nested pages and omitted .aspx extensions
  • register and document the command

Verification

Executed in an isolated Node.js 24 container on ubuntu-purva:

  • npm ci --no-audit --no-fund
  • npm run build
  • npm test (16,063 passing; 100% reported coverage)
  • cd docs && npm ci --no-audit --no-fund
  • node scripts/create-docs-versioning.mjs
  • cd docs && npm run build
  • git diff --check

Limitations

Local validation covered Linux with Node.js 24. Cross-platform and additional Node.js version coverage is left to the repository CI matrix.

@Anikesh348 Anikesh348 closed this Aug 13, 2026
@Anikesh348 Anikesh348 reopened this Aug 13, 2026
@milanholemans

Copy link
Copy Markdown
Contributor

@Anikesh348, please follow our guidelines and first ask to be assigned to an issue before working on it. This makes sure that there are not multiple people working on the same issue.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds spo page unpublish for unpublishing modern SharePoint pages, including nested and extensionless page names.

Changes:

  • Implements and registers the command.
  • Adds comprehensive command tests.
  • Adds command documentation and sidebar navigation.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/m365/spo/commands/page/page-unpublish.ts Implements page unpublishing.
src/m365/spo/commands/page/page-unpublish.spec.ts Tests behavior, validation, and errors.
src/m365/spo/commands.ts Registers the command.
docs/src/config/sidebars.ts Adds sidebar navigation.
docs/docs/cmd/spo/page/page-unpublish.mdx Documents usage and examples.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +51 to +56
const requestOptions: CliRequestOptions = {
url: `${args.options.webUrl}/_api/web/GetFileByServerRelativePath(DecodedUrl='${formatting.encodeQueryParameter(filePath)}')/UnPublish`,
headers: {
accept: 'application/json;odata=nometadata'
}
};
Comment on lines +39 to +41
## Response

The command won't return a response on success.
@milanholemans
milanholemans marked this pull request as draft August 31, 2026 22:45
@milanholemans

Copy link
Copy Markdown
Contributor

Can you make the suggested changes by copilot and get you assigned to the issue? After this you can reopen the PR.

@Anikesh348
Anikesh348 force-pushed the feature/spo-page-unpublish branch from acdcba6 to 24f52a1 Compare September 3, 2026 06:10
@Anikesh348

Copy link
Copy Markdown
Author

Thanks for the review. I applied Copilot's two suggestions: the UnPublish request now uses responseType: 'json', and the command docs include the Permissions section (SharePoint AllSites.Write delegated and Sites.ReadWrite.All application), matching page set.

Could you please assign me to #7540? I'm marking this PR ready for review.

@Anikesh348
Anikesh348 marked this pull request as ready for review September 3, 2026 06:10
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.

New command: spo page unpublish

3 participants