Skip to content

Enhances 'spo site hubsite' commands with admin permissions#7101

Merged
MartinM85 merged 1 commit intopnp:mainfrom
milanholemans:hubsite
Feb 18, 2026
Merged

Enhances 'spo site hubsite' commands with admin permissions#7101
MartinM85 merged 1 commit intopnp:mainfrom
milanholemans:hubsite

Conversation

@milanholemans
Copy link
Copy Markdown
Contributor

Closes #5970

Copilot AI review requested due to automatic review settings January 12, 2026 00:40
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request enhances the spo site hubsite connect and spo site hubsite disconnect commands by adding an --asAdmin option that allows SharePoint administrators to perform these operations using tenant admin APIs. The PR also migrates both commands from the legacy options/validators pattern to the modern Zod schema validation pattern.

Changes:

  • Added --asAdmin option to enable hub site connection/disconnection operations as a SharePoint administrator
  • Migrated both commands from legacy validation to Zod schema validation
  • Updated tests to use schema-based validation and added test coverage for the new asAdmin functionality
  • Enhanced documentation with permissions tables and examples demonstrating the new asAdmin option

Reviewed changes

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

Show a summary per file
File Description
site-hubsite-disconnect.ts Migrated to Zod schema validation and added asAdmin option to use tenant admin API endpoint
site-hubsite-disconnect.spec.ts Updated tests to use schema validation and added test for asAdmin functionality
site-hubsite-connect.ts Migrated to Zod schema validation and added asAdmin option to use tenant admin API endpoint
site-hubsite-connect.spec.ts Updated tests to use schema validation and added test for asAdmin functionality
site-hubsite-disconnect.mdx Added documentation for asAdmin option, permissions table, and usage example
site-hubsite-connect.mdx Added documentation for asAdmin option, permissions table, and usage example

Comment thread src/m365/spo/commands/site/site-hubsite-disconnect.spec.ts
Comment thread src/m365/spo/commands/site/site-hubsite-connect.spec.ts
@MartinM85 MartinM85 self-assigned this Feb 15, 2026
Copy link
Copy Markdown
Contributor

@MartinM85 MartinM85 left a comment

Choose a reason for hiding this comment

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

Nice work @milanholemans. No comments from my side.

@MartinM85 MartinM85 merged commit 13a2e29 into pnp:main Feb 18, 2026
16 checks passed
@milanholemans milanholemans deleted the hubsite branch February 18, 2026 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Connect and disconnect hub site as SP admin

3 participants