Simple powershell ping log with timestamp

Here's a quick and dirty script that will ping with a timestamp, and save the ouput to a text file. I have used pingInfoView quite a bit, but sometimes this fits the situation better.

$hostAddress = Read-Host -Prompt 'IP Address or Hostname'
$fileName = Read-Host -Prompt 'Output file'

ping.exe -t $hostAddress|Foreach{"{0} - {1}" -f (Get-Date),$_}| Tee-Object -file $fileName


Popular posts from this blog

Delay dropbox startup in Windows

Lockdown Browser LAB SCCM deployment

Move Windows 7 Users folder to another drive