Skip to content

Fixes 'spo user get' retrieving user by id#7459

Open
milanholemans wants to merge 1 commit into
pnp:mainfrom
milanholemans:fix-spo-user-get
Open

Fixes 'spo user get' retrieving user by id#7459
milanholemans wants to merge 1 commit into
pnp:mainfrom
milanholemans:fix-spo-user-get

Conversation

@milanholemans

Copy link
Copy Markdown
Contributor

Closes #7458

Copilot AI review requested due to automatic review settings July 20, 2026 14:42

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

This PR addresses #7458 by fixing m365 spo user get so it can retrieve a SharePoint user by ID (as passed from the CLI), updating option typing/validation and extending validation tests.

Changes:

  • Stops forcing --id to be parsed as a string and updates validation to use validation.isValidPositiveInteger.
  • Updates the validation error message for invalid --id values.
  • Adds additional validation tests for invalid numeric id inputs (negative/float).

Reviewed changes

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

File Description
src/m365/spo/commands/user/user-get.ts Updates option typing and id validation logic to accept a positive integer ID passed via CLI.
src/m365/spo/commands/user/user-get.spec.ts Adds extra validation test coverage for invalid id values.

Comment thread src/m365/spo/commands/user/user-get.ts
Comment thread src/m365/spo/commands/user/user-get.spec.ts
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.

Bug report: unable to get user by ID

2 participants