none
Pipeline, parameter visibility

    Question

  • Hello,

    if i write a custom function with parameters, is there a way to make a parameter visible only if the function is called after a pipe.
    And the same parameter hidden if the function is called in "standalone mode"

    example :

    get-aduser | get-myfunction -TestParameter "truc"
    testparameter can only be "tabbed" if get-myfonction is called after a pipe.


    Tuesday, April 18, 2017 7:00 PM

Answers

  • Why?  Parameters are chosen based on parameter set.  They cannot be "hidden".  They can only be selected by set.


    \_(ツ)_/

    • Marked as answer by TonQ Tuesday, April 18, 2017 8:13 PM
    Tuesday, April 18, 2017 7:08 PM
  • Agree with jrv - why? What problem are you really trying to solve?

    -- Bill Stewart [Bill_Stewart]

    • Marked as answer by TonQ Tuesday, April 18, 2017 8:13 PM
    Tuesday, April 18, 2017 7:11 PM
    Moderator

All replies

  • Why?  Parameters are chosen based on parameter set.  They cannot be "hidden".  They can only be selected by set.


    \_(ツ)_/

    • Marked as answer by TonQ Tuesday, April 18, 2017 8:13 PM
    Tuesday, April 18, 2017 7:08 PM
  • Agree with jrv - why? What problem are you really trying to solve?

    -- Bill Stewart [Bill_Stewart]

    • Marked as answer by TonQ Tuesday, April 18, 2017 8:13 PM
    Tuesday, April 18, 2017 7:11 PM
    Moderator
  • no problem here, i was just wondering if it was possible that's all :)
    Tuesday, April 18, 2017 8:13 PM