Change the input file to this.
Host;Type
x.y.z.11;Firewall
x.y.z.12;Switch
And the script to this.
$Systemes = import-csv "C:\hosts.csv" -delimiter ";"
foreach ($System in $Systemes) {
if (test-Connection -Computername $System.Host -Count 1 -Quiet ) {
"{0} {1} is online!" -f $System.Host, $System.Type | Write-Host -ForegroundColor Green
} else {
"{0} {1} is offline!" -f $System.Host, $System.Type | Write-Host -ForegroundColor Red
}
}
Pause