I have two cmdlets, Get-MyBuilding and Get-MyRoom, which pull information on buildings and rooms from a school API. Each room belongs to a building, and therefore has a BuildingID. Get-MyRoom can be used with either “-RoomID” or “-BuildingID”.
In the same way as you would use [pre]Get-ADGroup “mygroup” | Get-ADGroupMember[/pre] I would like to be able to call [pre]Get-MyBuilding “mybuilding” | Get-MyRoom[/pre]
My question is, can this pipeline usage be achieved with ValueFromPipeline, or will it only work with ValueFromPipelineByPropertyName? To make things more complicated, I also want the -RoomID parameter to support pipeline input.
Any advice appreciated!