Update MS Graph Connection Handling - #98
Draft
SrBlackVoid wants to merge 3 commits into
Draft
Conversation
Aims to centralize the MS Graph connection process.
Found it odd EntitlementManagement was listed only in the Start- functions and nowhere else. Ran checks of all called endpoints thru Find-MgGraphCommand, found that [DeviceManagement]ManagedDevices was also incorrect; it should be Scripts.
SrBlackVoid
force-pushed
the
Update-Connection-Handling
branch
from
March 15, 2026 21:33
c5de233 to
8606395
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.
The primary change added here is refactoring the MS Graph connection handling into a centralized function. The way it is structured should allow for different required scopes based on the process being performed.
Also noticed that a couple of the listed scopes may be incorrect:
The current changes in this PR also fix that.
Currently marked as a draft because there's still a couple ideas to add here (open to feedback):
The backup functions should really only require Read.All scopes. I know it's easier to require ReadWrite.All across the board to ensure parity across all functions, but it does present a potential security risk if the intended usage is simply to perform the backup process, not the restore process.
Potential hot take: this module shouldn't be trying to automate/fix the connection to MS Graph at all; just checking that the required scopes are there, and exiting out if that is not the case.