I'm trying to create a PowerShell function which wraps another function. I want my function to take a variable number of arguments and to pass those onto the wrapped function. Is there anyway to do this?
Specifically what I am trying to do is something like this:
function MakeRequest() {
if ($session) {
$resp = Invoke-WebRequest -WebSession $session $args
} else {
$resp = Invoke-WebRequest -SessionVariable session $args
}
$resp
}