How do I pass common powershell command line parameters between cmdlets on the pipeline? -


Say I have two CMDlets, 'New-Foo' and 'Do-Bar' for both CMDlets to take action A service is required to be certified, and 'do-bar' takes a fue. Today, I can:

  new-foo -host localhost -username user-password password - whatever other  

and I can :

  Two-time public localhost - User-password password -Foo Myfu  

And I can also credit them to pass the foo on the pipeline I like:

  new-foo & lt; Blah blah & gt; | Do-bar -host localhost -username user-password password  

But I can not understand how to pass the credentials between normal parameters, such as service space and pipeline elements. If I have found a group of my own CMDlets, then I only want to pass the credential for the first time, and then want to reuse them for the rest of the pipeline.

What am I missing, it seems that it should be clear ...

You can exit New-Foo from the object in which both the original object which has two-time side-by-side service space and credentials such as credentials. Accept this object as a parameter, and after that you if does not supply user service space or credential criteria.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -