$strcomputers = "computer1", "computer2"
$failoutput = "location, state `n"
foreach ($strcomputer in $strcomputers)
{
$test = "$($strcomputer), is online. `n"
if (!(test-connection -computername $strcomputer -count 1 -quiet))
{
$test = "$($strcomputer), is not online or exsist. `n"
}
$failoutput += $test
}
$failoutput