I would like to be able to pipe output to the screen as well as to ‘append’ it to a variable.
For example, for something like this:
$result =@()
$result += Invoke-Command -cn $servers -scriptblock { foo }
I would like to be able to see on the screen the running output of
Invoke-Command -cn $servers -scriptblock { foo }
as well as capture each result to the $result variable.