title: Delete a list of files from a list of servers in powershell
body: <p>I need to delete a list of files (in remove-files.txt) from a list of server (computer-list.txt). I've tried the following but it didn't work, i am hoping someone can please help me correct my errors.</p>
  
  <pre><code>$SOURCE = "C:\powershell\copy\data"
  $DESTINATION = "d$\copy"
  $LOG = "C:\powershell\copy\logsremote_copy.log"
  $REMOVE = Get-Content C:\powershell\copy\remove-list.txt
  
  Remove-Item $LOG -ErrorAction SilentlyContinue
  $computerlist = Get-Content C:\powershell\copy\computer-list.txt
  
  foreach ($computer in $computerlist) {
  Remove-Item \\$computer\$DESTINATION\$REMOVE -Recurse}
  </code></pre>
  
  <p>ERROR </p>
  
  <hr>
  
  <pre><code>Remove-Item : Cannot find path '\\NT-xxxx-xxxx\d$\copy\File1.msi, File2.msi, File3.exe,          File4, File5.msi,' because it does not exist.
  At C:\powershell\copy\REMOVE_DATA_x.ps1:13 char:12
  + Remove-Item &lt;&lt;&lt;&lt;  \\$computer\$DESTINATION\$REMOVE -Recurse}
  + CategoryInfo          : ObjectNotFound: (\\NT-xxxx-xxxxx\...-file1.msi,:String)     [Remove-Item], ItemNotFoundException
  + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand
  </code></pre>