Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Invoke-PnPGraphMethod null exception #3133

Merged
merged 2 commits into from
May 23, 2023

Conversation

jackpoz
Copy link
Contributor

@jackpoz jackpoz commented May 23, 2023

Type

  • Bug Fix
  • New Feature
  • Sample

Related Issues?

No linked issues

What is in this Pull Request ?

Fix Invoke-PnPGraphMethod showing a null exception error message when invoking graph with missing privilegies. A better error message "Insufficient privileges to complete the operation." is displayed instead.

This PR was created during a LearningAtLunch at work, sharing knowledge while eating salad 🥗 (or pizza 🍕). Sharing is caring 😃

How to reproduce steps

  • Create an app registration with no Graph permissions to access Groups
  • Run the script
Invoke-PnPGraphMethod -url "/v1.0/groups/da938e88-2c16-4f2a-ad35-018a972cd126"

Before the PR:
image

After the PR:
image

Summary

copilot:summary

Details

copilot:walkthrough

jackpoz and others added 2 commits May 23, 2023 12:45
Fix Invoke-PnPGraphMethod null exception when calling Graph with missing permissions
@gautamdsheth gautamdsheth merged commit 2192bf7 into pnp:dev May 23, 2023
@gautamdsheth
Copy link
Collaborator

Thanks @jackpoz , much appreciated 😊🙌

Sharing is caring !!

@jackpoz jackpoz deleted the fixed/InvokeGraphMethodNullException branch August 10, 2024 13:44
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.

2 participants