switch = $true, $false, $nulle
good morning :)
pls wath rigth do?
switch ($wwws) { {$_ -ne $true}{write-host $sk"." $_":" $calc "meter/sekunden"; $sk++;} {$_ -eq $nulle}{write-host $sk"." $_ ": site nicht erreichbar"; $sk++;} }
my best regrad
arnold
good morning sir :)
i dont resultat. @ moment
i no or no bad.
die durchschnittliche zeit f
ür eine ping-antwort ist ??
ende der abfrage.
foreach ($wwws in $www){ $pingserver = test-connection -count 1 ($wwws) $avg = ($pingserver | measure-object responsetime -average) $calc = [system.math]::round($avg.average) for ($k = 0; $k -lt $avgwww; $k ++ ) { $pingserver.$wwws } switch ($wwws) { $true {write-host $sk"." $wwws ":" $calc "meter/sekunden"; $sk++;} $null {write-host $sk"." $wwws ": server nicht erreichbar"; $sk++;} } } write-host "" write-host "ende der abfrage: gute $true.count, schlechte $null.count pings." write-host ""
my beste regard
arnold
Windows Server > Windows PowerShell
Comments
Post a Comment