Invoking Get-Process remotely with a script block
<p>I am trying to get process information of a process using powershell.</p>

<p>So, I have something like this</p>

<pre><code>$command = {  Get-Process -Name process* }
$res = Invoke-Command -session $session -scriptblock $command
Remove-PSSession $session
Write-Host $res
</code></pre>

<p>My output is</p>

<pre><code>System.Diagnostics.Process (process)
</code></pre>

<p>When I login to the box and run Get-Process -Name process I get much more information such as Handles, NPM, PK, CPU, etc...</p>

<p>How can I get the same information using Invoke-Command ?</p>