Remove Logs
A couple of our web servers were running into some issues with disk space. Turns out the logs weren’t being cleaned up properly. In order to remediate this, I wrote a function that can be reused anywhere. The function accepts 3 parameters: FilePath: The directory where you want to remove the logs from CutOff; Specifies the age (in days) that a file must have before being deleted. LogPath; This parameter specifies the directory where you want the CSV log file....