microsoft-graph-explorer-v4 icon indicating copy to clipboard operation
microsoft-graph-explorer-v4 copied to clipboard

Include 'Connect-MgGraph -Scopes <permission>' for PowerShell Code snippets

Open dweverett opened this issue 3 years ago • 2 comments

Is your feature request related to a problem? Please describe. Issuing an MS Graph API call shows how to use the corresponding PowerShell cmdlet to perform that task, when the admin clicks "Code snippets" > PowerShell. The example generated even includes which module to import. What it lacks, and causes the command to fail, are the permissions that are required for the command to work. This forces the frustrated admin to have to locate the API documentation again in order to determine the permissions that are required. Once they know the permissions, they must re-authenticate with Connect-MgGraph while specifying the correct -Scopes.

Describe the solution you'd like In addition to showing the Import-Module command, the "Code snippet" for "PowerShell" should also include Connect-MgGraph -Scopes that will allow the command to run.

Describe alternatives you've considered There is no alternative unless we want to continue to force frustrated admins to have to look for the API docs page so they can look up the permission. Giving them the scope will also help drive MS Graph PowerShell adoption.

Additional context N/A

dweverett avatar Jun 10 '22 18:06 dweverett

Hey @dweverett. Sorry about this. A quick way to locate permissions for any query is on the Modify Permissions tab: image Also, to quickly locate docs, there is a button on the extreme right of the query textbox which takes you to the correct documentation image

image

I understand that you prefer to have the scopes pre-populated on the cmdlet. Let me escalate this as a feature request and tag the appropriate teams.

Onokaev avatar Jun 27 '22 11:06 Onokaev

Hey @dweverett. For now, permissions required for specific request urls are on the Modify permissions tab. Whenever they are not available on the tab, the next option is to check the documentation through the 'Learn more' button. Appending scopes to the snippets will cause a subpar experience in cases where there are quite a number of scopes to consent to.

Onokaev avatar Aug 02 '22 11:08 Onokaev

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

ghost avatar Aug 14 '22 11:08 ghost