Skip to content

Improve Pipelining Support #7

@afscrome

Description

@afscrome

Add support for pipelining, so commands like the following can be done

Get-Blog -Id 123 | Get-BlogPost
Get-CommunityForum -Id 12 | Remove-CommunityForum

The commands already support binding fromt eh pipeline, the main problem is that the objects ont eh entity names don't usually match waht the command wants. e.g. on a blog entity, the Id is named Id whereas the rest endpoint wants BlogId and can't map the two.

To support this, I'm thinking of adding some dynamic aliases when processing a response entity.
https://github.com/afscrome/SampleDataGenerator/blob/master/CommunityRest/Common.ps1#L285-L288

i.e. if there is a property called Id and the entity is of type FOO, add an alias so FOOId as an alias of Id. (do this recursively for all nested entities). This can be done with something like:

Add-Member -MemberType AliasProperty -Name FOOId -Value Id -PassThru

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions