header
header Register : : Login header
header
divider
menuleft
menuright
submenu
left

We have a new sponsor!  Introducting Pragma Systems.  See the home page for details.

Passing $args to helper ScriptBlock to Parse
Last Post 03 Dec 2009 09: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:123
Avatar

--
03 Dec 2009 09: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.1
right
   
footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 footer
footer