while ($true) { $ms = Resolve-DnsName microsoft.com "{0} - Number of records = {1} Total net connections = {2}" -f (get-date) , $ms.count, (Get-NetTCPConnection).count start-sleep -Seconds 30 }