$domain='google.com'
function pingSomething($x){
$result=ping $x
function getTraceroute($y){
pathping $y
}
$result+=getTraceroute $x
return $result
}
$job=Start-Job -ScriptBlock {
param($importedFunction,$params)
[ScriptBlock]::Create($importedFunction).invoke($params)
} -Args ${function:pingSomething},$domain
Wait-Job $job|out-null
Receive-Job $job
Categories: