This PowerShell script will continuously prints the current time and pings an IP address.
It will run in a loop until you press Ctrl+C
to stop it.
# Replace <IP> with target host IP address
try {
while ($true) {
$timestamp = Get-Date -Format 'yyyy-MM-dd HH:mm:ss'
$pingResult = ping -n 1