Calling module in a module, both having optional params?

by Sep 22, 2011

I have a module (o) that wraps an external module (i). module i has optinal params so module o need to accept (or not) those optional params and pass those set params over to module i. How is this done??

The below does not work (would i need an eval? note im using pseudo below. Please give full answer thanks –

function Set-O {
  #psuedo
   $_a is required
   $_b is not required
   $_c is required

  # call external module method with conditional params e.g.
  Set-I -A $_a if($_b neq $null){ -B $_b} -C $_c

}

#pseudo
export Set-O

##############################################

 

# calls to method
Set-O -A 'aaa' -C 'ccc'
Set-O -A 'aaa' -B 'bbb' -C 'ccc'

Simple request, but im not seeing the answer. Thanks for any help.