Add Get-PnPUserOneDriveLocation cmdlet#5382
Merged
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new tenant-admin cmdlet, Get-PnPUserOneDriveLocation, which returns SharePoint Online multi-geo location details (location code, OneDrive URL, site ID) for a user's OneDrive personal site. It reuses the existing internal MultiGeoRestApiClient and follows the established pattern of the sibling multi-geo admin cmdlets (base class, permission attributes, REST version negotiation, and case-insensitive deserialization).
Changes:
- Added a
GetUserPersonalSiteLocationmethod toMultiGeoRestApiClient, targeting theUserPersonalSiteLocation('{upn}')REST path. - Added the
UserPersonalSiteLocationoutput model and theGet-PnPUserOneDriveLocationcmdlet, plus its documentation. - Added a
Current nightly→Addedchangelog entry.
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/Commands/Utilities/MultiGeo/MultiGeoRestApiClient.cs | Adds the REST method and constants to fetch a user's personal site location; consistent with existing lookups. |
| src/Commands/Model/UserPersonalSiteLocation.cs | New output model with UserPrincipalName, Location, MySiteUrl, SiteId; matches sibling model conventions. |
| src/Commands/Admin/GetUserOneDriveLocation.cs | New cmdlet; missing [ValidateNotNullOrEmpty] on UserPrincipalName compared to sibling cmdlets. |
| documentation/Get-PnPUserOneDriveLocation.md | New cmdlet docs; structure and alphabetical parameter order are consistent. |
| CHANGELOG.md | Adds the nightly entry; missing the PR link used by all sibling entries. |
| ## [Current nightly] | ||
|
|
||
| ### Added | ||
| - Added `Get-PnPUserOneDriveLocation` cmdlet to retrieve SharePoint Online multi-geo location details for a user's OneDrive personal site. |
Collaborator
Author
There was a problem hiding this comment.
Added the PR link to the Current nightly changelog entry.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.
Summary
Get-PnPUserOneDriveLocationusing the existing SharePoint Online multi-geo REST client.UserPersonalSiteLocationoutput model withUserPrincipalName,Location,MySiteUrl, andSiteIdproperties.Validation
dotnet restore src\PnP.PowerShell.slndotnet build src\PnP.PowerShell.sln --no-restore --verbosity minimalGet-PnPUserOneDriveLocationsyntax/metadata.