assume $computerarray exists
$resultarray = @()
foreach($computer in $computerarray)
{invoke-command $computer.name -scriptblock {
$result = do-some-stuff
if ($result = “awesome”){$result2 = do-other-stuff}
}
how might I get $results and/or $result2 out of the scriptblock and into $resultarray? I know how to build an array by adding members to psobject rows, i’m really asking about getting content out of the remote session and back into $resultarray.