mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-22 12:41:24 +01:00
Updated ping-host.ps1
This commit is contained in:
parent
82156d8fe6
commit
73a3b6b65c
@ -18,7 +18,7 @@ param([string]$hostname = "x.com")
|
||||
|
||||
try {
|
||||
$remoteHosts = $hostname.Split(",")
|
||||
$tasks = $remoteHosts | foreach { (New-Object Net.NetworkInformation.Ping).SendPingAsync($_,3000) }
|
||||
$tasks = $remoteHosts | foreach { (New-Object Net.NetworkInformation.Ping).SendPingAsync($_,5000) }
|
||||
[Threading.Tasks.Task]::WaitAll($tasks)
|
||||
foreach($ping in $tasks.Result) {
|
||||
if ($ping.Status -eq "Success") {
|
||||
|
Loading…
Reference in New Issue
Block a user