Feature Request: Pipeline Input
This module should support pipeline input where possible.
Get-MgUser -UserId e5c3398d-6401-4dd6-bb87-6d3f95499aef | Get-MgUserLicenseDetail
Get-MgGroup -GroupId 0f764d03-afb6-45cd-a720-84708fc0d5dc | Get-MgGroupMember | Get-MgUser
I'm sure the team has their own ideas on how this could work, but I feel like adding an alias property to the output of the commands would be a good solution.
For example:
Get-MgGroup | Add-Member -MemberType AliasProperty -Name 'GroupId' -Value 'Id'
... so now the output has a GroupId property that's the same as Id.
Now all that's necessary is to add the ValueFromPipelineByPropertyName attribute to the GroupId parameter on Get-MgGroupMember.
I realise this is easier said than done, given that you're auto-generating the functions.
We are still waiting for the code generator (AutoREST.PowerShell) to support ValueFromPipelineByPropertyName for path parameters. This is being tracked in https://github.com/Azure/autorest.powershell/issues/616
A breaking change will occur because we will need to drop support for -InputObject parameter set to support piping by
ValueFromPipelineByPropertyName - Get-MgUser (Microsoft.Graph.Users) | Microsoft Learn.
AutoREST uses -InputObject to support piping via ValueFrompipeline, which doesn't work for MS Graph as explained at https://github.com/Azure/autorest.powershell/issues/616. Adding support for piping via ValueFromPipelineByPropertyName has the effect of breaking customers who've taken a dependency on the publicly documented InputObject parameter.
@timayabi2020, is there a design for this feature put down anywhere?