msgraph-sdk-powershell icon indicating copy to clipboard operation
msgraph-sdk-powershell copied to clipboard

Get-Mguser in msgraph beta version cannot add parameter '-Property'

Open caiwan-msft opened this issue 3 years ago • 2 comments

Issue: Get-Mguser in msgraph beta version cannot add parameter '-Property'

image

Compare with msgraph v1.0: image

Thanks, caiwan

caiwan-msft avatar Mar 22 '23 07:03 caiwan-msft

Thanks for following up on this.

This looks like a service issue in Microsoft Graph China cloud. As per the API reference, $ prefix is optional in beta - https://learn.microsoft.com/en-us/graph/query-parameters.

On the beta endpoint, the $ prefix is optional. For example, instead of $filter, you can use filter. On the v1 endpoint, the $ prefix is optional for only a subset of APIs. For simplicity, always include $ if using the v1 endpoint.

The SDK currently assumes $ is optional in beta as per the above guideline. Infact, the same request works as expected when calling beta endpoint in Microsoft Graph global cloud:

Get-MgUser -Select displayName, lastPasswordChangeDateTime | select DisplayName, LastPasswordChangeDateTime image

We will use this issue to track adding $ prefix to all OData query paramters in both v1.0 and beta to support all National Clouds.

peombwa avatar Mar 23 '23 18:03 peombwa

Fixed by #1993. The fix will ship as part of v2.0.0-preview9, scheduled for release this week.

peombwa avatar May 03 '23 20:05 peombwa