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
Add support for pipelining, so commands like the following can be done
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
Idwhereas the rest endpoint wantsBlogIdand 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
Idand the entity is of type FOO, add an alias soFOOIdas an alias ofId. (do this recursively for all nested entities). This can be done with something like: