During a deployment I often find myself restarting the CacheBuilder and watching the log for changes. To make things easier on myself I wrote a quick PowerShell script to stop the service, rename the current log with the current timestamp, and start the service again. This gives me a nice clean log to look through for my troubleshooting. I thought I would share the script here in case anyone else would find it useful.
# Enter the folder that contains the CacheBuilder.log file
$Folder = "C:\InetPub\CiresonPortal\bin\Logs"
$CacheBuilder = Join-Path $Folder "CacheBuilder.log"
# Rename current log with timestamp
Rename-Item $CacheBuilder "CacheBuilder_$((Get-Date).ToFileTime()).log"
# Start CacheBuilder
Write-Output "CacheBuilder.log was not found in $Folder"