I often have scripts I write that involve passing potentially different sets of commands to cmdlets based on switches I pass to the script. Some provide built in means to make it easy:
-Verbose:($PSBoundParameters['Verbose'] -eq $true) In the case where I need to invoke a binary, I push the extra arg into the array list passed to the System.Diagnostics.Process job as the arglist. Works well. If I am simply running a cmdlet: Some-Cmdlet ` -Param1 xxx ` -Param2 xxx If I tack another back tick on param2, what powershell foo allows a conditional 3rd param to be passed? Would be so much tidier than if/else and duplicating the whole thing. Thanks! jlc ~ Finally, powerful endpoint security that ISN'T a resource hog! ~ ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~ --- To manage subscriptions click here: http://lyris.sunbelt-software.com/read/my_forums/ or send an email to listmana...@lyris.sunbeltsoftware.com with the body: unsubscribe ntsysadmin