param( [string]$logfile = "$env:temp\bom_ephemeralportstat.log" ) if (Test-Path($logfile)) { $ret= [int]((Select-String "TimeWait" $logfile).Line -Replace "\D","") return $ret } else { return "Error: no monitoring data." }