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?