Ping -n <NO_OF_SECONDS> 192.168.20.1 | ForEach {"{0} - {1}" -f (Get-Date),$_} >> <PATH_TO_TXT_LOG>

ex:

Ping -n 900 192.168.20.1 | ForEach {"{0} - {1}" -f (Get-Date),$_} >> C:\\\\TEMP\\\\PingTest-Internal.txt
netsh winsock reset
netsh int ip reset
netsh interface ipv4 show config
netsh interface ipv4 set dns name=2 static 8.8.8.8