I am getting rolling on powershell and wanted to get-eventlog on several computer from one cmdlet.
I have been reading http:/
The example: >Do-Something -computername (Get-Content names.txt)
I put a two workstation hostnames in a txt file named hosts.txt and ran this cmdlet.
get-eventlog -logname system -entrytype error -newest 20 -comp (get-content hosts.txt)
So far so good. My problem is when a hostname in the file can not be reached for some reason, it errors and stops. I get nothing. I want it to just skip the unreachable host and move on to the rest. Hww do I do that?