I have a large list of hostnames I need to ping to see if they are up or down. I\'m not really that great at scripting but I managed to figure this much out:
I would do it this way. Using a list of computers and -asjob works very well. The Responsetime property will be non-null if the host is up.
$names = Get-content hnames.txt test-connection $names -asjob -count 1 | recieve-job -wait -auto