34 lines
670 B
PowerShell
34 lines
670 B
PowerShell
$urls = @(
|
|
"www.google.de"
|
|
"www.amazon.de"
|
|
"www.github.com"
|
|
"www.youtube.com"
|
|
"www.gibtsnicht.com"
|
|
)
|
|
|
|
$start = Get-Date
|
|
|
|
$urls | ForEach-Object -Parallel {
|
|
$reachable = Test-Connection -ComputerName $_ -Quiet
|
|
if($reachable){
|
|
Write-Host "$($_) is reachable"
|
|
}else {
|
|
Write-Host "$($_) could not be reached"
|
|
}
|
|
}
|
|
<#
|
|
$urls | ForEach-Object {
|
|
$reachable = Test-Connection -ComputerName $_ -Quiet
|
|
if($reachable){
|
|
Write-Host "$($_) is reachable"
|
|
}else {
|
|
Write-Host "$($_) could not be reached"
|
|
}
|
|
}
|
|
#>
|
|
|
|
$end = Get-Date
|
|
$duration = $end - $start
|
|
|
|
|
|
Write-Host "Laufzeit: $($duration.TotalSeconds)" |