microsoftgraph / msgraph-sdk-powershell

Powershell SDK for Microsoft Graph
https://www.powershellgallery.com/packages/Microsoft.Graph
Other
696 stars 168 forks source link

Missing Cmdlet: "beta/roleManagement/directory/roleEligibilitySchedules/filterByCurrentUser(on='principal')" #1255

Closed JustinGrote closed 2 years ago

JustinGrote commented 2 years ago

https://docs.microsoft.com/en-us/graph/api/unifiedroleeligibilityschedule-filterbycurrentuser?view=graph-rest-beta&tabs=http

The powershell example is incorrect, recommend this be a switchparameter -FilterByCurrentUser on the command Get-MgRoleManagementDirectoryRoleEligibilitySchedule and other related commands on the API

Workaround

Invoke-MgGraphRequest -Uri "beta/roleManagement/directory/roleEligibilitySchedules/filterByCurrentUser(on='principal')"

peombwa commented 2 years ago

Thanks for bringing this to our attention.

The PowerShell snippet in the API reference doc is wrong and needs to be updated. I've opened an issue at https://github.com/microsoftgraph/microsoft-graph-devx-api/issues/1023 for this to be fixed. The right command to use is Invoke-MgFilterRoleManagementDirectoryRoleEligibilitySchedule -On "'principal'":

➜ Find-MgGraphCommand -Uri "/roleManagement/directory/roleEligibilitySchedules/filterByCurrentUser.*"

   APIVersion: beta

Command                                                       Module                     Method URI                                                                             OutputType                                    Permissions Variants
-------                                                       ------                     ------ ---                                                                             ----------                                    ----------- --------
Invoke-MgFilterRoleManagementDirectoryRoleEligibilitySchedule DeviceManagement.Enrolment GET    /roleManagement/directory/roleEligibilitySchedules/filterByCurrentUser(on={on}) IMicrosoftGraphUnifiedRoleEligibilitySchedule {}          {Filter, FilterViaIdentity}

We will address the truncation of prepositions (in this case, By) from command names in v2 of the SDK - https://github.com/microsoftgraph/msgraph-sdk-powershell/issues/912.

The suggestion of using -FilterByCurrentUser switch parameter is a valid feature request, but we are currently limited to the path-based naming convention that's supported by our code generator, AutoREST.PowerShell. We will consider supporting this in the future.

ghost commented 2 years ago

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.