microsoftgraph / msgraph-metadata

Microsoft Graph metadata captured and used for generating client library code files.
https://graph.microsoft.com
MIT License
104 stars 31 forks source link

The function name is incorrect: Get-MgDeviceManagementDeviceCustomAttributeShellScriptUserRunStateDeviceRunStateManagedDeviceCloudPcRemoteActionResult #133

Closed AshleyYangSZ closed 2 years ago

AshleyYangSZ commented 2 years ago

Issue found by this https://twitter.com/alexandair/status/1504088670718017537?t=Ze2i48cMhOHxyn202NCjjA&s=19 And the link to the doc: https://docs.microsoft.com/en-us/powershell/module/microsoft.graph.devicemanagement.functions/get-mgdevicemanagementdevicecustomattributeshellscriptuserrunstatedevicerunstatemanageddevicecloudpcremoteactionresult?view=graph-powershell-beta

Get-MgDeviceManagementDeviceCustomAttributeShellScriptUserRunStateDeviceRunStateManagedDeviceCloudPcRemoteActionResult

This should be Get-MgDeviceManagementManagedDeviceCloudPcRemoteActionResult

peombwa commented 2 years ago

Thanks for bringing this to our attention.

Unfortunately, Get-MgDeviceManagementDeviceCustomAttributeShellScriptUserRunStateDeviceRunStateManagedDeviceCloudPcRemoteActionResult is defined as a valid API path in the CSDL metadata, our single source of truth. Get-MgDeviceManagementManagedDeviceCloudPcRemoteActionResult already exists and is mapped to the right API, i.e.,

Current metadata definition

The workload owner should provide a fix by removing the ContainsTarget="true" from deviceRunStates navigation properties on deviceManagementScriptUserState entity. Alternatively, we can apply an XSLT transform to remove the ContainsTarget="true" as a temporary fix.

AshleyYangSZ commented 2 years ago

Hi @peombwa Thanks for you explanation, since I'm not the owner of the two metadata, could we move forward with the second option? _Alternatively, we can apply an XSLT transform to remove the ContainsTarget="true" as a temporary fix firstly? image

peombwa commented 2 years ago

@AshleyYangSZ. Awesome! I'll remove them.

peombwa commented 2 years ago

We should also remove the following unsupported paths/commands: image image

Only the commands highlighted in yellow are supported.

Related to https://github.com/microsoftgraph/msgraph-sdk-powershell/pull/1221#issuecomment-1130019432.

peombwa commented 2 years ago

The workload has already fixed the issue in the metadata:

➜ Find-MgGraphCommand -Command .*-Mg.*RemoteActionResult

Command                                                        Module                     URI
-------                                                        ------                     ---
Get-MgDeviceManagementComanagedDeviceCloudPcRemoteActionResult DeviceManagement.Functions /deviceManagement/comanagedDevices/{managedDevice-id}/getCloudPcRemoteActionResults
Get-MgDeviceManagementManagedDeviceCloudPcRemoteActionResult   DeviceManagement.Functions /deviceManagement/managedDevices/{managedDevice-id}/getCloudPcRemoteActionResults
Get-MgUserManagedDeviceCloudPcRemoteActionResult               Users.Functions            /users/{user-id}/managedDevices/{managedDevice-id}/getCloudPcRemoteActionResults

➜ Find-MgGraphCommand -Command .*-MgBulkReprovision.*

Command                                                        Module                   URI
-------                                                        ------                   ---
Invoke-MgBulkReprovisionDeviceManagementComanagedDeviceCloudPc DeviceManagement.Actions /deviceManagement/comanagedDevices/bulkReprovisionCloudPc
Invoke-MgBulkReprovisionDeviceManagementManagedDeviceCloudPc   DeviceManagement.Actions /deviceManagement/managedDevices/bulkReprovisionCloudPc
Invoke-MgBulkReprovisionUserManagedDeviceCloudPc               Users.Actions            /users/{user-id}/managedDevices/bulkReprovisionCloudPc

➜ Find-MgGraphCommand -Command .*-MgBulkRestore.*

Command                                                    Module                   URI
-------                                                    ------                   ---
Invoke-MgBulkRestoreDeviceManagementComanagedDeviceCloudPc DeviceManagement.Actions /deviceManagement/comanagedDevices/bulkRestoreCloudPc
Invoke-MgBulkRestoreDeviceManagementManagedDeviceCloudPc   DeviceManagement.Actions /deviceManagement/managedDevices/bulkRestoreCloudPc
Invoke-MgBulkRestoreUserManagedDeviceCloudPc               Users.Actions            /users/{user-id}/managedDevices/bulkRestoreCloudPc

➜ Find-MgGraphCommand -Command .*-MgReprovision.*

Command                                                    Module                   URI
-------                                                    ------                   ---
Invoke-MgReprovisionDeviceManagementComanagedDeviceCloudPc DeviceManagement.Actions /deviceManagement/comanagedDevices/{managedDevice-id}/reprovisionCloudPc
Invoke-MgReprovisionDeviceManagementManagedDeviceCloudPc   DeviceManagement.Actions /deviceManagement/managedDevices/{managedDevice-id}/reprovisionCloudPc
Invoke-MgReprovisionUserManagedDeviceCloudPc               Users.Actions            /users/{user-id}/managedDevices/{managedDevice-id}/reprovisionCloudPc

The refreshed commands will be available as part of https://github.com/microsoftgraph/msgraph-sdk-powershell/pull/1330.

peombwa commented 2 years ago

Closed by https://github.com/microsoftgraph/msgraph-sdk-powershell/releases/tag/1.10.0