Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

splatting & extra arguements

$
0
0

Hi,

I am writing a series of wrapper functions for new-ADUser and Set-ADuser cmdlets.  I seem to have reached a dead end on how to approach this.  My problem is that I have a long list of params defined in the set-ADUser wrapper func and I want to avoid having to duplicate those params on the new-Aduser wrapped function.  Is there a simple way where I can have multiple functions share the same or similar params without duplication?  An alternative might be to have limited params on  the wrapped new-aduser func then have it call the wrapped set-aduser func once the user is created however I think I am reaching a limitation with how I can accept the params of the set-aduser func from new-aduser (if that makes sense).  I have been playing with ValueFromRemainingArguments however unless I can push that data into PSBoundParameters easily I'm not sure if that's really a good way of doing things. Thanks in advance.


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>