Closed JustinGrote closed 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.
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.
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 commandGet-MgRoleManagementDirectoryRoleEligibilitySchedule
and other related commands on the APIWorkaround
Invoke-MgGraphRequest -Uri "beta/roleManagement/directory/roleEligibilitySchedules/filterByCurrentUser(on='principal')"