How to run Get-ChildItem command on a remote machine
<p>I need to run the following:</p>

<pre><code>Get-ChildItem Cert:\LocalMachine -Recurse
</code></pre>

<p>on a remote machine. For instance I have a loop:</p>

<pre><code>foreach ($server in $serverList) {
   if((Test-Connection -Cn $server -BufferSize 16 -Count 1 -ea 0 -quiet))
   {
        $certs = Get-ChildItem Cert:\LocalMachine -Recurse | Select Thumbnail, subject
        .....
   }
}
</code></pre>

<p>How can I ensure it runs on the remote machine?</p>