You also have the option to use advanced features instead of the basic approach above:
function set-something { param( [Parameter(ValueFromPipeline=$true)] $piped )
Obviously, only one parameter can be associated directly with pipelined input. However, you can have several parameters that communicate with different properties when entering a pipeline:
function set-something { param( [Parameter(ValueFromPipelineByPropertyName=$true)] $Prop1, [Parameter(ValueFromPipelineByPropertyName=$true)] $Prop2, )
Hope this helps you on your journey to explore another shell.
source share