header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
Passing $args to helper ScriptBlock to Parse
Last Post 03 Dec 2009 01:25 PM by 0ptikGhost. 0 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
0ptikGhostUser is Offline
Basic Member
Basic Member
Posts:296
Avatar

--
03 Dec 2009 01:25 PM

    I have scenario where I have a function that needs to pass all the items in $args to a helper script block to actually parse the arguments. Something like this:

    $parse = { param([string]$paramerter,[switch]$switch) return (DoStuffWith $parameter $switch) } function ParseWrapper { # prep environment $parsedObject = & $parse $args # do stuff with $parsedObject }

    The problem I have is that $args in ParseWrapper is passed to $parse as the first parameter (array) rather than separate parameters. Is there a way to pass $args to $parse so that it can parse the parameters?

    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer