microsoftgraph / microsoftgraph/msgraph-sdk-powershell

Microsoft Access Reviews Documentation Powershell Formatting Error

Open
#2,847 0 comments 0 reactions 1 assignee View on GitHub

@timayabi2020 is already working on this.

Since Feb 13, 2025.

area:documentation type:bug
Dominant language
C#
Stars
898
Forks
230
Avg merge
2d 5h
Merged PRs (30d)
31

Description

Describe the bug

Access Review api examples have a incorrect formatting when translated into powershell scripts. Single quotations are translated into the wrong encoding causing requests to fail without good user feedback. This is an issue with any occurrence of single quotes, but was realized with the query scope field here: https://learn.microsoft.com/en-us/graph/api/accessreviewset-post-historydefinitions?view=graph-rest-1.0&tabs=powershell

For example, this scope provided in the example gives error
query = "/identityGovernance/accessReviews/definitions?$filter=contains(scope/query, '/groups')"

This is the correct formatting
query = '/identityGovernance/accessReviews/definitions?$filter=contains(scope/query, ''/groups'')'

Note the two differences are surrounding the property in single quotes instead of double, and escaping each single quote in the property with another single quote.

These scopes are used through access reviews apis, and it would be ideal to fix it across the board.

Expected behavior

I expect users to be able to use given examples from documentation.

How to reproduce

Using Microsoft graph powershell SDK, submit an access review history report request here: https://learn.microsoft.com/en-us/graph/api/accessreviewset-post-historydefinitions?view=graph-rest-1.0&tabs=powershell. This will return 400, and network traces show the single quotations converted into \u0027. However the 400 response does not give any helpful user feedback.

SDK Version

No response

Latest version known to work for scenario above?

No response

Known Workarounds

Users must manuall change powershell example. However most customers do not know to do this

Debug output
Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.