microsoft-graph-devx-api icon indicating copy to clipboard operation
microsoft-graph-devx-api copied to clipboard

Incomplete example

Open lkchild opened this issue 3 years ago • 7 comments

Under Example 2: Write extensionAttributes on a device - Request, there are multiple examples.

All of the code examples show how you can set extensionAttribute1 (and thus how you change 2, 3, 4, etc.)

The PowerShell example does not. It just says $params with an empty definition, and doesn't show you how to set the attribute, or specify extensionAttribute1, 2, 3 etc..

Can you please complete the PowerShell example to show how to choose and set the extensionAttribute1, 2, 3 etc. on a device?

Thanks, Lauren


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

lkchild avatar Sep 20 '22 14:09 lkchild

This issue has been assigned to you, @SanDeo-MSFT. You are listed as the author for the document associated with this issue. If this is not correct, please take the following actions.

  • Assign this issue to the correct author
  • Create a pull request to update the author field in the YAML front-matter of this topic

github-actions[bot] avatar Sep 20 '22 14:09 github-actions[bot]

@msewaweru - Please assist here. Thanks.

FaithOmbongi avatar Jan 17 '23 06:01 FaithOmbongi

@FaithOmbongi , there seems to be an issue with the example generation from the HTTP example. Since the example is autogenerated, would updating it manually be overwritten in future by the process?

msewaweru avatar Jan 17 '23 09:01 msewaweru

@FaithOmbongi , there seems to be an issue with the example generation from the HTTP example. Since the example is autogenerated, would updating it manually be overwritten in future by the process?

@msewaweru - Yes, a manually updated snippet will be overwritten. I see this problem also here Example 4: Add or update the values of a schema extension for a user and affects only PS. Also, this article has many examples for working with different extension types and most PS examples are marked "snippets not available". So this might be pointing to an SDK gap.

In the interim, I've raised a PR to request fresh snippets for the device-update and user-update examples. We can check back in a week to see if the problem is resolved in new snippets.

FaithOmbongi avatar Jan 17 '23 14:01 FaithOmbongi

@FaithOmbongi , there seems to be an issue with the example generation from the HTTP example. Since the example is autogenerated, would updating it manually be overwritten in future by the process?

@msewaweru - Yes, a manually updated snippet will be overwritten. I see this problem also here Example 4: Add or update the values of a schema extension for a user and affects only PS. Also, this article has many examples for working with different extension types and most PS examples are marked "snippets not available". So this might be pointing to an SDK gap.

In the interim, I've raised a PR to request fresh snippets for the device-update and user-update examples. We can check back in a week to see if the problem is resolved in new snippets.

Thanks, @FaithOmbongi.

msewaweru avatar Jan 17 '23 14:01 msewaweru

Per @FaithOmbongi transferring to DevX API repo for snippet generation investigation

jasonjoh avatar Jan 30 '23 17:01 jasonjoh

Hi @msewaweru - I requested fresh snippets but the example still has an empty $params as per the original issue.

Import-Module Microsoft.Graph.Identity.DirectoryManagement

$params = @{
}

Update-MgDevice -DeviceId $deviceId -BodyParameter $params

FaithOmbongi avatar Feb 06 '23 10:02 FaithOmbongi