I like to leave log files where people can find them. Typically this is on their desktop, or in the same folder where the script ran from. I wrote the following bit of code which creates a date based report file and offers it as a default. It is pretty straightforward, but I did not know about the date formatting bit until I did this.
#Define default log
$lfd ="$env:userProfileDesktop"+$(Get-Date).ToString("yyyyMMdd_HHmm")+"_Report.txt"
#prompt for logfile unless specfied with -Logfile parameter (not shown)
if (!$LogFile){
$logfile = Read-Host "Enter path to text log file, or ENTER for default,`n$lfd"
}
#use default log if not specified
if ($LogFile.Length -eq 0) {$LogFile = $lfd}
Write-Host $LogFile