title: Invoke-Command doesn't return anything from my Get-ChildItem
body: <p>This script doesnt return anything to the $file parameter. if i do it without the Invoke-Command on the server itself it does find a file.</p>
  
  <p>Remote Example:   </p>
  
  <pre><code>$file =Invoke-command -ComputerName $server -Credential $cred -ArgumentList $fileName -scriptblock{param($fileName)(Get-ChildItem -Recurse -Force "C:" -ErrorAction SilentlyContinue | Where-Object { ($_.PSIsContainer -eq $false) -and  ( $_.Name -eq $fileName) })}
  
  write-host $file
  write-host $file.PSPath
  
  if($file -ne $null -or $file -ne ""){
          $path= $file.PSPath
      }
  return $path
  </code></pre>
  
  <p>Local example:</p>
  
  <pre><code>$file = Get-ChildItem -Recurse -Force "C:" -ErrorAction SilentlyContinue | Where-Object { ($_.PSIsContainer -eq $false) -and  ( $_.Name -eq $fileName) }
  write-host $file
  write-host $file.PSPath
  if($file -ne $null -or $file -ne ""){
          $path= $file.PSPath
      }
  return $path
  </code></pre>