While i think i found a way around my problem then another one arises... but let's start from my solution:
DO {
write-host "$(get-date -f HH:mm:ss) $(get-date -f dd/MM/yyyy) - Host is online"
sleep 5
} While (Test-Connection 192.168.110.85 -BufferSize 16 -Count 1 -Quiet)
Write-Host "$(get-date -f HH:mm:ss) $(get-date -f dd/MM/yyyy) - Host is offline"
It works, the problem is that this loop might never exit because if for some reason the host never powers down this script will run forever.
I was thinking to try to execute this for a number of times and then exit anyway but i dont' know how to do this.
Suggestions?