I am new to powershell but I am trying to learn. Right now, I need to set a scheduled script to run every 10 minutes and ping on of our servers while saving that information to a log file. I have a script that does this but the issue I am facing is with the log.txt
Every time the script runs it overwrites the log file. My questions is: how can I tell powershell to update the log file and not overwrite the contents of it when it is run?
My script: Ping.exe <HOSTNAME> | ForEach {"{0} - {1}" -f (Get-Date),$_} > D:\ping.txt