title: check for text in a file on a remote machine
body: <p>I am using a powershell to query a file on a remote machines C-drive and if the file exist with status 'imaging completed' it should run other checks.</p>
  
  <pre><code>$filetofind = Get-Content C:\Image.log
  
  #Get the list down to just imagestatus and export
  foreach ($line in $filetofind)
      {
      $file = $line.trim("|")
      echo $file &gt;&gt; C:\jenkins\imagestatus.txt
      }
  </code></pre>
  
  <p>But when I run below commands I am getting the error. 
  Can anyone help ?</p>
  
  <pre>Get-Content : Cannot find path 'C:\Image.log' because it does not exist.
      At line:18 char:15
      + $filetofind = Get-Content C:\Image.log
      +               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : ObjectNotFound: (C:\Image.log:String) [Get-Content], ItemNotFoundException
          + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand
  </pre>