Add PnP geo administrator cmdlet#5381
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new SharePoint Online admin cmdlet, Add-PnPGeoAdministrator, to manage multi-geo administrators via the existing MultiGeo REST API infrastructure.
Changes:
- Introduces
Add-PnPGeoAdministratorwith parameter sets forUserPrincipalName,GroupAlias, andObjectId. - Extends
MultiGeoRestApiClientwith aGeoAdministratorsPOST operation and API-version gating. - Adds minimal internal request/response models, enum, and cmdlet documentation.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Commands/Utilities/MultiGeo/MultiGeoRestApiClient.cs | Adds GeoAdministrators endpoint support and version checks. |
| src/Commands/Model/GeoAdministratorEntityData.cs | Introduces request payload model for adding geo admins. |
| src/Commands/Model/GeoAdministrator.cs | Introduces response model (extends request payload with GeoLocation). |
| src/Commands/Enums/GroupMemberType.cs | Adds enum for principal type serialization. |
| src/Commands/Admin/AddGeoAdministrator.cs | Adds the new Add-PnPGeoAdministrator cmdlet implementation. |
| documentation/Add-PnPGeoAdministrator.md | Adds user-facing cmdlet documentation with examples and syntax. |
| CHANGELOG.md | Adds a “Current nightly” entry for the new cmdlet. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
7532d82 to
a0743ac
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before creating a pull request, make sure that you have read the contribution file located at
https://github.com/pnp/powerShell/blob/dev/CONTRIBUTING.md
Type
Related Issues?
N/A
What is in this Pull Request ?
Adds
Add-PnPGeoAdministratorto mirror SharePoint Online Management Shell'sAdd-SPOGeoAdministratorfor multi-geo administrators.The cmdlet supports the same
UserPrincipalName,GroupAlias, andObjectIdparameter sets, reuses the existing multi-geo REST client, and posts to theGeoAdministratorsAPI with matching payload shape and no output. This also adds the minimal internal models, documentation, and Current nightly changelog entry.Validation included building the project and comparing command metadata and payload serialization with the SPO module.
Guidance
N/A