title: Return running process status for servers in Powershell and export to CSV
body: <p>I am trying to get my head around Powershell and have the following:</p>
  
  <pre><code>$servers = Get-Content -Path C:\servers.txt
  
  Get-Process -name AVProcess -cn $servers | % where {$_.Status -eq "Running"}
  
  #Export-Csv -path "C:\server-process-sophos.csv"
  </code></pre>
  
  <p>I get an error, it looks like i cant use the $servers Variable within the parameter computername, also sending to the CSV file is way off. Ideally i'd like to be able to pipe each server name, status of the process into rows in a CSV.</p>
  
  <p>I am trying to return a list of servers which do/dont have that process running or not - so i can see if they have AV installed essentially for an inventory report (this is not good if some dont have AV!!!). How can i best go about this?</p>
  
  <p>Thanks in advance</p>