$NotResponding = @() $Ping_Result = @() $Script:DeviceCollection_ServerNames1.Name | % { $Server = $_ $Obj = New-Object -TypeName PSObject If (Test-Connection $Server -Count 1 -ErrorAction SilentlyContinue ) { #Write-Host "Responding:---- $_ " -ForegroundColor Green #$Script:Output.AppendText("Responding: $_") $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $Server $Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "Yes" $Ping_Result += $Obj }#endIf Else { $NotResponding += $Server $Obj | Add-Member -MemberType NoteProperty -Name Server -Value $Server $Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "No!" $Ping_Result += $Obj } }#end% $Ping_Result $NotResponding